Re: [PATCH] cxgbit: fix dma_addr_t printk format

From: Arnd Bergmann
Date: Fri Mar 04 2016 - 19:35:13 EST


On Friday 04 March 2016 16:25:07 Joe Perches wrote:
> >
> > 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)
>
> You could create a temporary:
>
> for_each_sg(sgl, sg, nents, i) {
> dma_addr_t addr = sg_dma_address(sg);
>
> pr_info("\t%d/%u, 0x%p: len %u, off %u, pg 0x%p, dma %pad, %u\n",
> i, nents, sg, sg->length, sg->offset, sg_page(sg),
> &addr, sg_dma_len(sg));
> }
>

Sure, but the cast seemed nicer in this case, the result is the same.

Arnd