Skip to content

Commit e58566b

Browse files
tndavedavem330
authored andcommitted
qlogicpti: Fix compiler warnings
qlogicpti uses '__u32' for dma handle while invoking kernel DMA APIs, instead of using dma_addr_t. This hasn't caused any 'incompatible pointer type' warning on SPARC because until now dma_addr_t is of type u32. However, recent changes in SPARC ATU (iommu) enabled 64bit DMA and therefore dma_addr_t became of type u64. This makes 'incompatible pointer type' warnings inevitable. e.g. drivers/scsi/qlogicpti.c: In function ‘qpti_map_queues’: drivers/scsi/qlogicpti.c:813: warning: passing argument 3 of ‘dma_alloc_coherent’ from incompatible pointer type ./include/linux/dma-mapping.h:445: note: expected ‘dma_addr_t *’ but argument is of type ‘__u32 *’ drivers/scsi/qlogicpti.c:822: warning: passing argument 3 of ‘dma_alloc_coherent’ from incompatible pointer type ./include/linux/dma-mapping.h:445: note: expected ‘dma_addr_t *’ but argument is of type ‘__u32 *’ For the record, qlogicpti never executes on sun4v. Therefore even though 64bit DMA is enabled on SPARC, qlogicpti continues to use legacy iommu that guarantees DMA address is always in 32bit range. This patch resolves aforementioned compiler warnings. Signed-off-by: Tushar Dave <tushar.n.dave@oracle.com> Reviewed-by: thomas tai <thomas.tai@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 9dd35d6 commit e58566b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/scsi/qlogicpti.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,8 +356,8 @@ struct qlogicpti {
356356

357357
/* The rest of the elements are unimportant for performance. */
358358
struct qlogicpti *next;
359-
__u32 res_dvma; /* Ptr to RESPONSE bufs (DVMA)*/
360-
__u32 req_dvma; /* Ptr to REQUEST bufs (DVMA) */
359+
dma_addr_t res_dvma; /* Ptr to RESPONSE bufs (DVMA)*/
360+
dma_addr_t req_dvma; /* Ptr to REQUEST bufs (DVMA) */
361361
u_char fware_majrev, fware_minrev, fware_micrev;
362362
struct Scsi_Host *qhost;
363363
int qpti_id;

0 commit comments

Comments
 (0)