From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752669AbcCGOPT (ORCPT ); Mon, 7 Mar 2016 09:15:19 -0500 Received: from stargate.chelsio.com ([12.32.117.8]:10351 "EHLO stargate.chelsio.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752273AbcCGOPN (ORCPT ); Mon, 7 Mar 2016 09:15:13 -0500 Date: Mon, 7 Mar 2016 19:44:55 +0530 From: Varun Prakash To: Arnd Bergmann CC: "Nicholas A. Bellinger" , , , Subject: Re: [PATCH] cxgbit: fix dma_addr_t printk format Message-ID: <20160307141453.GA1799@chelsio.com> References: <1457136294-2229829-1-git-send-email-arnd@arndb.de> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1457136294-2229829-1-git-send-email-arnd@arndb.de> User-Agent: Mutt/1.5.21 (2010-09-15) X-Originating-IP: [10.193.190.56] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > 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.