From: Varun Prakash <varun@chelsio.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: "Nicholas A. Bellinger" <nab@linux-iscsi.org>,
linux-scsi@vger.kernel.org, target-devel@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] cxgbit: fix dma_addr_t printk format
Date: Mon, 7 Mar 2016 19:44:55 +0530 [thread overview]
Message-ID: <20160307141453.GA1799@chelsio.com> (raw)
In-Reply-To: <1457136294-2229829-1-git-send-email-arnd@arndb.de>
On Sat, Mar 05, 2016 at 01:04:41AM +0100, Arnd Bergmann wrote:
> The newly added driver prints a dma_addr_t using the %llx format string,
> but that is wrong on most 32-bit architectures:
>
> drivers/target/iscsi/cxgbit/cxgbit_ddp.c: In function 'cxgbit_dump_sgl':
> drivers/target/iscsi/cxgbit/cxgbit_ddp.c:180:10: error: format '%llx' expects argument of type 'long long unsigned int', but argument 8 has type 'dma_addr_t {aka unsigned int}' [-Werror=format=]
> pr_info("\t%d/%u, 0x%p: len %u, off %u, pg 0x%p, dma 0x%llx, %u\n",
>
> Unfortunately, we can't use the %pad format string here because
> we are not printing an lvalue, so we have to add a cast to u64, which
> matches the format string on all architectures.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: c49aa56e556d ("cxgbit: add cxgbit_ddp.c")
> ---
> drivers/target/iscsi/cxgbit/cxgbit_ddp.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/target/iscsi/cxgbit/cxgbit_ddp.c b/drivers/target/iscsi/cxgbit/cxgbit_ddp.c
> index 07e2bc86d0df..d667bc88e21d 100644
> --- a/drivers/target/iscsi/cxgbit/cxgbit_ddp.c
> +++ b/drivers/target/iscsi/cxgbit/cxgbit_ddp.c
> @@ -179,7 +179,7 @@ cxgbit_dump_sgl(const char *cap, struct scatterlist *sgl, int nents)
> for_each_sg(sgl, sg, nents, i)
> pr_info("\t%d/%u, 0x%p: len %u, off %u, pg 0x%p, dma 0x%llx, %u\n",
> i, nents, sg, sg->length, sg->offset, sg_page(sg),
> - sg_dma_address(sg), sg_dma_len(sg));
> + (u64)sg_dma_address(sg), sg_dma_len(sg));
> }
>
> static int cxgbit_ddp_sgl_check(struct scatterlist *sgl, int nents)
Ok, I will update the original commit in v2 series, thanks.
WARNING: multiple messages have this Message-ID (diff)
From: Varun Prakash <varun@chelsio.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: "Nicholas A. Bellinger" <nab@linux-iscsi.org>,
<linux-scsi@vger.kernel.org>, <target-devel@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] cxgbit: fix dma_addr_t printk format
Date: Mon, 7 Mar 2016 19:44:55 +0530 [thread overview]
Message-ID: <20160307141453.GA1799@chelsio.com> (raw)
In-Reply-To: <1457136294-2229829-1-git-send-email-arnd@arndb.de>
On Sat, Mar 05, 2016 at 01:04:41AM +0100, Arnd Bergmann wrote:
> The newly added driver prints a dma_addr_t using the %llx format string,
> but that is wrong on most 32-bit architectures:
>
> drivers/target/iscsi/cxgbit/cxgbit_ddp.c: In function 'cxgbit_dump_sgl':
> drivers/target/iscsi/cxgbit/cxgbit_ddp.c:180:10: error: format '%llx' expects argument of type 'long long unsigned int', but argument 8 has type 'dma_addr_t {aka unsigned int}' [-Werror=format=]
> pr_info("\t%d/%u, 0x%p: len %u, off %u, pg 0x%p, dma 0x%llx, %u\n",
>
> Unfortunately, we can't use the %pad format string here because
> we are not printing an lvalue, so we have to add a cast to u64, which
> matches the format string on all architectures.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: c49aa56e556d ("cxgbit: add cxgbit_ddp.c")
> ---
> drivers/target/iscsi/cxgbit/cxgbit_ddp.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/target/iscsi/cxgbit/cxgbit_ddp.c b/drivers/target/iscsi/cxgbit/cxgbit_ddp.c
> index 07e2bc86d0df..d667bc88e21d 100644
> --- a/drivers/target/iscsi/cxgbit/cxgbit_ddp.c
> +++ b/drivers/target/iscsi/cxgbit/cxgbit_ddp.c
> @@ -179,7 +179,7 @@ cxgbit_dump_sgl(const char *cap, struct scatterlist *sgl, int nents)
> for_each_sg(sgl, sg, nents, i)
> pr_info("\t%d/%u, 0x%p: len %u, off %u, pg 0x%p, dma 0x%llx, %u\n",
> i, nents, sg, sg->length, sg->offset, sg_page(sg),
> - sg_dma_address(sg), sg_dma_len(sg));
> + (u64)sg_dma_address(sg), sg_dma_len(sg));
> }
>
> static int cxgbit_ddp_sgl_check(struct scatterlist *sgl, int nents)
Ok, I will update the original commit in v2 series, thanks.
next prev parent reply other threads:[~2016-03-07 14:14 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-05 0:04 [PATCH] cxgbit: fix dma_addr_t printk format Arnd Bergmann
2016-03-05 0:25 ` Joe Perches
2016-03-05 0:34 ` Arnd Bergmann
2016-03-05 2:20 ` Joe Perches
2016-03-07 14:14 ` Varun Prakash [this message]
2016-03-07 14:14 ` Varun Prakash
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=20160307141453.GA1799@chelsio.com \
--to=varun@chelsio.com \
--cc=arnd@arndb.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=nab@linux-iscsi.org \
--cc=target-devel@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.