* Re: [PATCH for-4.1] iw_cxgb4: Fix kbuild bot reported warnings
[not found] ` <1430246138-3218-1-git-send-email-hariprasad-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
@ 2015-04-28 13:57 ` Doug Ledford
0 siblings, 0 replies; 2+ messages in thread
From: Doug Ledford @ 2015-04-28 13:57 UTC (permalink / raw)
To: Hariprasad Shenai
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA,
swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW,
leedom-ut6Up61K2wZBDgjK7y7TUQ, nirranjan-ut6Up61K2wZBDgjK7y7TUQ
[-- Attachment #1: Type: text/plain, Size: 4532 bytes --]
On Wed, 2015-04-29 at 00:05 +0530, Hariprasad Shenai wrote:
> Commit 20dca80f ("iw_cxgb4: 32b platform fixes") introduced warnings
> related to inappropriate argument type while printing arguments
The original patch has not yet been pushed upstream. There is no need
to submit both it and a fix patch. I've already modified my copy of
your patch to correct the errors (most of them, there were two spots I
missed that need corrected still). However, that said...
> Reported by: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
> Reported by: kbuild test robot <fengguang.wu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> Signed-off-by: Hariprasad Shenai <hariprasad-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
> ---
> drivers/infiniband/hw/cxgb4/cq.c | 5 +++--
> drivers/infiniband/hw/cxgb4/mem.c | 4 ++--
> drivers/infiniband/hw/cxgb4/qp.c | 4 ++--
> 3 files changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/infiniband/hw/cxgb4/cq.c b/drivers/infiniband/hw/cxgb4/cq.c
> index be66d5d..1f114c0 100644
> --- a/drivers/infiniband/hw/cxgb4/cq.c
> +++ b/drivers/infiniband/hw/cxgb4/cq.c
> @@ -340,7 +340,8 @@ static void advance_oldest_read(struct t4_wq *wq)
> */
> void c4iw_flush_hw_cq(struct c4iw_cq *chp)
> {
> - struct t4_cqe *hw_cqe, *swcqe, read_cqe;
> + struct t4_cqe *hw_cqe = NULL;
> + struct t4_cqe *swcqe, read_cqe;
> struct c4iw_qp *qhp;
> struct t4_swsqe *swsqe;
> int ret;
> @@ -975,7 +976,7 @@ struct ib_cq *c4iw_create_cq(struct ib_device *ibdev, int entries,
> mm2->len = PAGE_SIZE;
> insert_mmap(ucontext, mm2);
> }
> - PDBG("%s cqid 0x%0x chp %p size %u memsize %zu, dma_addr 0x%0llx\n",
> + PDBG("%s cqid 0x%0x chp %p size %u memsize %lu, dma_addr 0x%0llx\n",
> __func__, chp->cq.cqid, chp, chp->cq.size,
> (uintptr_t)chp->cq.memsize,
^^^^^^^^^^
This is still wrong in your fixup. The uintptr_t is to
be used where you want to shove an int into a ptr or vice versa and you
know that the sizes are appropriate and you don't want the compiler
complaining. It isn't something that should be used in casting for a
printf format. So it shouldn't have been added here in the first place.
The right fix is to remove this cast so the original memsize printf
format works properly again.
> (unsigned long long) chp->cq.dma_addr);
> diff --git a/drivers/infiniband/hw/cxgb4/mem.c b/drivers/infiniband/hw/cxgb4/mem.c
> index 9a26649..42805f6 100644
> --- a/drivers/infiniband/hw/cxgb4/mem.c
> +++ b/drivers/infiniband/hw/cxgb4/mem.c
> @@ -930,7 +930,7 @@ struct ib_fast_reg_page_list *c4iw_alloc_fastreg_pbl(struct ib_device *device,
>
> PDBG("%s c4pl %p pll_len %u page_list %p dma_addr %pad\n",
> __func__, c4pl, c4pl->pll_len, c4pl->ibpl.page_list,
> - (void *)(uintptr_t)c4pl->dma_addr);
> + (dma_addr_t *)(uintptr_t)c4pl->dma_addr);
This is wrong too. It makes no sense to cast this as uintptr and then
back to dma_addr_t when it was dma_addr_t to begin with.
> return &c4pl->ibpl;
> }
> @@ -941,7 +941,7 @@ void c4iw_free_fastreg_pbl(struct ib_fast_reg_page_list *ibpl)
>
> PDBG("%s c4pl %p pll_len %u page_list %p dma_addr %pad\n",
> __func__, c4pl, c4pl->pll_len, c4pl->ibpl.page_list,
> - (void *)(uintptr_t)c4pl->dma_addr);
> + (dma_addr_t *)(uintptr_t)c4pl->dma_addr);
>
> dma_free_coherent(&c4pl->dev->rdev.lldi.pdev->dev,
> c4pl->pll_len,
> diff --git a/drivers/infiniband/hw/cxgb4/qp.c b/drivers/infiniband/hw/cxgb4/qp.c
> index 7ce40c3..176a238 100644
> --- a/drivers/infiniband/hw/cxgb4/qp.c
> +++ b/drivers/infiniband/hw/cxgb4/qp.c
> @@ -1784,8 +1784,8 @@ struct ib_qp *c4iw_create_qp(struct ib_pd *pd, struct ib_qp_init_attr *attrs,
> qhp->ibqp.qp_num = qhp->wq.sq.qid;
> init_timer(&(qhp->timer));
> INIT_LIST_HEAD(&qhp->db_fc_entry);
> - PDBG("%s sq id %u size %u memsize %zu num_entries %u "
> - "rq id %u size %u memsize %zu num_entries %u\n", __func__,
> + PDBG("%s sq id %u size %u memsize %lu num_entries %u "
> + "rq id %u size %u memsize %lu num_entries %u\n", __func__,
> qhp->wq.sq.qid, qhp->wq.sq.size, (unsigned long)qhp->wq.sq.memsize,
> attrs->cap.max_send_wr, qhp->wq.rq.qid, qhp->wq.rq.size,
> (unsigned long)qhp->wq.rq.memsize, attrs->cap.max_recv_wr);
--
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
GPG KeyID: 0E572FDD
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH for-4.1] iw_cxgb4: Fix kbuild bot reported warnings
@ 2015-04-28 18:35 Hariprasad Shenai
[not found] ` <1430246138-3218-1-git-send-email-hariprasad-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Hariprasad Shenai @ 2015-04-28 18:35 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA
Cc: dledford-H+wXaHxf7aLQT0dZR+AlfA,
swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW,
leedom-ut6Up61K2wZBDgjK7y7TUQ, nirranjan-ut6Up61K2wZBDgjK7y7TUQ,
Hariprasad Shenai
Commit 20dca80f ("iw_cxgb4: 32b platform fixes") introduced warnings
related to inappropriate argument type while printing arguments
Reported by: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
Reported by: kbuild test robot <fengguang.wu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Hariprasad Shenai <hariprasad-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
---
drivers/infiniband/hw/cxgb4/cq.c | 5 +++--
drivers/infiniband/hw/cxgb4/mem.c | 4 ++--
drivers/infiniband/hw/cxgb4/qp.c | 4 ++--
3 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/drivers/infiniband/hw/cxgb4/cq.c b/drivers/infiniband/hw/cxgb4/cq.c
index be66d5d..1f114c0 100644
--- a/drivers/infiniband/hw/cxgb4/cq.c
+++ b/drivers/infiniband/hw/cxgb4/cq.c
@@ -340,7 +340,8 @@ static void advance_oldest_read(struct t4_wq *wq)
*/
void c4iw_flush_hw_cq(struct c4iw_cq *chp)
{
- struct t4_cqe *hw_cqe, *swcqe, read_cqe;
+ struct t4_cqe *hw_cqe = NULL;
+ struct t4_cqe *swcqe, read_cqe;
struct c4iw_qp *qhp;
struct t4_swsqe *swsqe;
int ret;
@@ -975,7 +976,7 @@ struct ib_cq *c4iw_create_cq(struct ib_device *ibdev, int entries,
mm2->len = PAGE_SIZE;
insert_mmap(ucontext, mm2);
}
- PDBG("%s cqid 0x%0x chp %p size %u memsize %zu, dma_addr 0x%0llx\n",
+ PDBG("%s cqid 0x%0x chp %p size %u memsize %lu, dma_addr 0x%0llx\n",
__func__, chp->cq.cqid, chp, chp->cq.size,
(uintptr_t)chp->cq.memsize,
(unsigned long long) chp->cq.dma_addr);
diff --git a/drivers/infiniband/hw/cxgb4/mem.c b/drivers/infiniband/hw/cxgb4/mem.c
index 9a26649..42805f6 100644
--- a/drivers/infiniband/hw/cxgb4/mem.c
+++ b/drivers/infiniband/hw/cxgb4/mem.c
@@ -930,7 +930,7 @@ struct ib_fast_reg_page_list *c4iw_alloc_fastreg_pbl(struct ib_device *device,
PDBG("%s c4pl %p pll_len %u page_list %p dma_addr %pad\n",
__func__, c4pl, c4pl->pll_len, c4pl->ibpl.page_list,
- (void *)(uintptr_t)c4pl->dma_addr);
+ (dma_addr_t *)(uintptr_t)c4pl->dma_addr);
return &c4pl->ibpl;
}
@@ -941,7 +941,7 @@ void c4iw_free_fastreg_pbl(struct ib_fast_reg_page_list *ibpl)
PDBG("%s c4pl %p pll_len %u page_list %p dma_addr %pad\n",
__func__, c4pl, c4pl->pll_len, c4pl->ibpl.page_list,
- (void *)(uintptr_t)c4pl->dma_addr);
+ (dma_addr_t *)(uintptr_t)c4pl->dma_addr);
dma_free_coherent(&c4pl->dev->rdev.lldi.pdev->dev,
c4pl->pll_len,
diff --git a/drivers/infiniband/hw/cxgb4/qp.c b/drivers/infiniband/hw/cxgb4/qp.c
index 7ce40c3..176a238 100644
--- a/drivers/infiniband/hw/cxgb4/qp.c
+++ b/drivers/infiniband/hw/cxgb4/qp.c
@@ -1784,8 +1784,8 @@ struct ib_qp *c4iw_create_qp(struct ib_pd *pd, struct ib_qp_init_attr *attrs,
qhp->ibqp.qp_num = qhp->wq.sq.qid;
init_timer(&(qhp->timer));
INIT_LIST_HEAD(&qhp->db_fc_entry);
- PDBG("%s sq id %u size %u memsize %zu num_entries %u "
- "rq id %u size %u memsize %zu num_entries %u\n", __func__,
+ PDBG("%s sq id %u size %u memsize %lu num_entries %u "
+ "rq id %u size %u memsize %lu num_entries %u\n", __func__,
qhp->wq.sq.qid, qhp->wq.sq.size, (unsigned long)qhp->wq.sq.memsize,
attrs->cap.max_send_wr, qhp->wq.rq.qid, qhp->wq.rq.size,
(unsigned long)qhp->wq.rq.memsize, attrs->cap.max_recv_wr);
--
2.3.4
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-04-28 18:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-28 18:35 [PATCH for-4.1] iw_cxgb4: Fix kbuild bot reported warnings Hariprasad Shenai
[not found] ` <1430246138-3218-1-git-send-email-hariprasad-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
2015-04-28 13:57 ` Doug Ledford
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox