diff options
author | Roland Dreier <rolandd@cisco.com> | 2008-04-17 00:01:09 -0400 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2008-04-17 00:01:09 -0400 |
commit | 71e0957c6291da030e6f89351846225876731df3 (patch) | |
tree | 4e3116aa86e767865ba2d862c0352cd7c33d9ac2 /drivers | |
parent | 9d84ab9c7e82e7b6b9f8c25794f64f65d021c8fd (diff) |
RDMA/nes: Use proper format and cast to print dma_addr_t
On some platforms, eg sparc64, dma_addr_t is not the same size as a
pointer, so printing dma_addr_t values by casting to void * and using
a %p format generates warnings. Fix this by casting to unsigned long
and using %lx instead. This fixes the warnings:
drivers/infiniband/hw/nes/nes_verbs.c: In function 'nes_setup_virt_qp':
drivers/infiniband/hw/nes/nes_verbs.c:1047: warning: cast to pointer from integer of different size
drivers/infiniband/hw/nes/nes_verbs.c:1078: warning: cast to pointer from integer of different size
drivers/infiniband/hw/nes/nes_verbs.c:1078: warning: cast to pointer from integer of different size
drivers/infiniband/hw/nes/nes_verbs.c: In function 'nes_reg_user_mr':
drivers/infiniband/hw/nes/nes_verbs.c:2657: warning: cast to pointer from integer of different size
Reported by Andrew Morton <akpm@linux-foundation.org>.
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/infiniband/hw/nes/nes_verbs.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/infiniband/hw/nes/nes_verbs.c b/drivers/infiniband/hw/nes/nes_verbs.c index 90fa06e4c9f4..e1671d843fe1 100644 --- a/drivers/infiniband/hw/nes/nes_verbs.c +++ b/drivers/infiniband/hw/nes/nes_verbs.c | |||
@@ -1043,10 +1043,10 @@ static int nes_setup_virt_qp(struct nes_qp *nesqp, struct nes_pbl *nespbl, | |||
1043 | u8 sq_pbl_entries; | 1043 | u8 sq_pbl_entries; |
1044 | 1044 | ||
1045 | pbl_entries = nespbl->pbl_size >> 3; | 1045 | pbl_entries = nespbl->pbl_size >> 3; |
1046 | nes_debug(NES_DBG_QP, "Userspace PBL, pbl_size=%u, pbl_entries = %d pbl_vbase=%p, pbl_pbase=%p\n", | 1046 | nes_debug(NES_DBG_QP, "Userspace PBL, pbl_size=%u, pbl_entries = %d pbl_vbase=%p, pbl_pbase=%lx\n", |
1047 | nespbl->pbl_size, pbl_entries, | 1047 | nespbl->pbl_size, pbl_entries, |
1048 | (void *)nespbl->pbl_vbase, | 1048 | (void *)nespbl->pbl_vbase, |
1049 | (void *)nespbl->pbl_pbase); | 1049 | (unsigned long) nespbl->pbl_pbase); |
1050 | pbl = (__le64 *) nespbl->pbl_vbase; /* points to first pbl entry */ | 1050 | pbl = (__le64 *) nespbl->pbl_vbase; /* points to first pbl entry */ |
1051 | /* now lets set the sq_vbase as well as rq_vbase addrs we will assign */ | 1051 | /* now lets set the sq_vbase as well as rq_vbase addrs we will assign */ |
1052 | /* the first pbl to be fro the rq_vbase... */ | 1052 | /* the first pbl to be fro the rq_vbase... */ |
@@ -1074,9 +1074,9 @@ static int nes_setup_virt_qp(struct nes_qp *nesqp, struct nes_pbl *nespbl, | |||
1074 | /* nesqp->hwqp.rq_vbase = bus_to_virt(*pbl); */ | 1074 | /* nesqp->hwqp.rq_vbase = bus_to_virt(*pbl); */ |
1075 | /*nesqp->hwqp.rq_vbase = phys_to_virt(*pbl); */ | 1075 | /*nesqp->hwqp.rq_vbase = phys_to_virt(*pbl); */ |
1076 | 1076 | ||
1077 | nes_debug(NES_DBG_QP, "QP sq_vbase= %p sq_pbase=%p rq_vbase=%p rq_pbase=%p\n", | 1077 | nes_debug(NES_DBG_QP, "QP sq_vbase= %p sq_pbase=%lx rq_vbase=%p rq_pbase=%lx\n", |
1078 | nesqp->hwqp.sq_vbase, (void *)nesqp->hwqp.sq_pbase, | 1078 | nesqp->hwqp.sq_vbase, (unsigned long) nesqp->hwqp.sq_pbase, |
1079 | nesqp->hwqp.rq_vbase, (void *)nesqp->hwqp.rq_pbase); | 1079 | nesqp->hwqp.rq_vbase, (unsigned long) nesqp->hwqp.rq_pbase); |
1080 | spin_lock_irqsave(&nesadapter->pbl_lock, flags); | 1080 | spin_lock_irqsave(&nesadapter->pbl_lock, flags); |
1081 | if (!nesadapter->free_256pbl) { | 1081 | if (!nesadapter->free_256pbl) { |
1082 | pci_free_consistent(nesdev->pcidev, nespbl->pbl_size, nespbl->pbl_vbase, | 1082 | pci_free_consistent(nesdev->pcidev, nespbl->pbl_size, nespbl->pbl_vbase, |
@@ -2653,10 +2653,10 @@ static struct ib_mr *nes_reg_user_mr(struct ib_pd *pd, u64 start, u64 length, | |||
2653 | 2653 | ||
2654 | nespbl->pbl_vbase = (u64 *)pbl; | 2654 | nespbl->pbl_vbase = (u64 *)pbl; |
2655 | nespbl->user_base = start; | 2655 | nespbl->user_base = start; |
2656 | nes_debug(NES_DBG_MR, "Allocated PBL memory, %u bytes, pbl_pbase=%p," | 2656 | nes_debug(NES_DBG_MR, "Allocated PBL memory, %u bytes, pbl_pbase=%lx," |
2657 | " pbl_vbase=%p user_base=0x%lx\n", | 2657 | " pbl_vbase=%p user_base=0x%lx\n", |
2658 | nespbl->pbl_size, (void *)nespbl->pbl_pbase, | 2658 | nespbl->pbl_size, (unsigned long) nespbl->pbl_pbase, |
2659 | (void*)nespbl->pbl_vbase, nespbl->user_base); | 2659 | (void *) nespbl->pbl_vbase, nespbl->user_base); |
2660 | 2660 | ||
2661 | list_for_each_entry(chunk, ®ion->chunk_list, list) { | 2661 | list_for_each_entry(chunk, ®ion->chunk_list, list) { |
2662 | for (nmap_index = 0; nmap_index < chunk->nmap; ++nmap_index) { | 2662 | for (nmap_index = 0; nmap_index < chunk->nmap; ++nmap_index) { |