mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-06 13:16:22 +00:00
scsi: esas2r: Remove unnecessary casts
In a number of places in esas2r_ioctl.c, the void* returned from pci_alloc_consistent() is cast unnecessarily. Remove casts. Issue identified with Coccinelle. Link: https://lore.kernel.org/r/20200820181411.866057-1-alex.dewar90@gmail.com Signed-off-by: Alex Dewar <alex.dewar90@gmail.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
parent
44f4daf867
commit
32417d7844
@ -1548,11 +1548,10 @@ static int allocate_fw_buffers(struct esas2r_adapter *a, u32 length)
|
|||||||
|
|
||||||
a->firmware.orig_len = length;
|
a->firmware.orig_len = length;
|
||||||
|
|
||||||
a->firmware.data = (u8 *)dma_alloc_coherent(&a->pcid->dev,
|
a->firmware.data = dma_alloc_coherent(&a->pcid->dev,
|
||||||
(size_t)length,
|
(size_t)length,
|
||||||
(dma_addr_t *)&a->firmware.
|
(dma_addr_t *)&a->firmware.phys,
|
||||||
phys,
|
GFP_KERNEL);
|
||||||
GFP_KERNEL);
|
|
||||||
|
|
||||||
if (!a->firmware.data) {
|
if (!a->firmware.data) {
|
||||||
esas2r_debug("buffer alloc failed!");
|
esas2r_debug("buffer alloc failed!");
|
||||||
@ -1895,11 +1894,11 @@ int esas2r_write_vda(struct esas2r_adapter *a, const char *buf, long off,
|
|||||||
|
|
||||||
if (!a->vda_buffer) {
|
if (!a->vda_buffer) {
|
||||||
dma_addr_t dma_addr;
|
dma_addr_t dma_addr;
|
||||||
a->vda_buffer = (u8 *)dma_alloc_coherent(&a->pcid->dev,
|
a->vda_buffer = dma_alloc_coherent(&a->pcid->dev,
|
||||||
(size_t)
|
(size_t)
|
||||||
VDA_MAX_BUFFER_SIZE,
|
VDA_MAX_BUFFER_SIZE,
|
||||||
&dma_addr,
|
&dma_addr,
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
|
|
||||||
a->ppvda_buffer = dma_addr;
|
a->ppvda_buffer = dma_addr;
|
||||||
}
|
}
|
||||||
@ -2064,11 +2063,10 @@ int esas2r_write_fs(struct esas2r_adapter *a, const char *buf, long off,
|
|||||||
re_allocate_buffer:
|
re_allocate_buffer:
|
||||||
a->fs_api_buffer_size = length;
|
a->fs_api_buffer_size = length;
|
||||||
|
|
||||||
a->fs_api_buffer = (u8 *)dma_alloc_coherent(
|
a->fs_api_buffer = dma_alloc_coherent(&a->pcid->dev,
|
||||||
&a->pcid->dev,
|
(size_t)a->fs_api_buffer_size,
|
||||||
(size_t)a->fs_api_buffer_size,
|
(dma_addr_t *)&a->ppfs_api_buffer,
|
||||||
(dma_addr_t *)&a->ppfs_api_buffer,
|
GFP_KERNEL);
|
||||||
GFP_KERNEL);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user