From: Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Hariprasad Shenai <hariprasad-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org,
leedom-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org,
nirranjan-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org
Subject: Re: [PATCH for-4.1] iw_cxgb4: Fix kbuild bot reported warnings
Date: Tue, 28 Apr 2015 09:57:38 -0400 [thread overview]
Message-ID: <1430229458.44548.89.camel@redhat.com> (raw)
In-Reply-To: <1430246138-3218-1-git-send-email-hariprasad-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org>
[-- 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 --]
prev parent reply other threads:[~2015-04-28 13:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
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 message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1430229458.44548.89.camel@redhat.com \
--to=dledford-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
--cc=hariprasad-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org \
--cc=leedom-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=nirranjan-ut6Up61K2wZBDgjK7y7TUQ@public.gmane.org \
--cc=swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox