[PATCH] mtd: fix the build warning for fsl_upm.c
Zang Roy-R61911
r61911 at freescale.com
Wed Sep 8 05:10:09 EDT 2010
> -----Original Message-----
> From: Artem Bityutskiy [mailto:dedekind1 at gmail.com]
> Sent: Wednesday, September 08, 2010 16:46 PM
> To: Zang Roy-R61911
> Cc: linux-mtd at lists.infradead.org; akpm at linux-foundation.org;
> dwmw2 at infradead.org; cbouatmailru at gmail.com
> Subject: Re: [PATCH] mtd: fix the build warning for fsl_upm.c
>
> On Wed, 2010-09-08 at 11:46 +0800, Roy Zang wrote:
> > Fix the build warning:
> >
> > drivers/mtd/nand/fsl_upm.c: In function 'fun_chip_init':
> > drivers/mtd/nand/fsl_upm.c:190: warning: format '%x' expects type 'unsigned
> int', but argument 3 has type 'resource_size_t'
> >
> > Signed-off-by: Roy Zang <tie-fei.zang at freescale.com>
> > ---
> > drivers/mtd/nand/fsl_upm.c | 4 ++--
> > 1 files changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/mtd/nand/fsl_upm.c b/drivers/mtd/nand/fsl_upm.c
> > index 4eff8b2..dc61ecf 100644
> > --- a/drivers/mtd/nand/fsl_upm.c
> > +++ b/drivers/mtd/nand/fsl_upm.c
> > @@ -186,8 +186,8 @@ static int __devinit fun_chip_init(struct fsl_upm_nand
> *fun,
> > if (!flash_np)
> > return -ENODEV;
> >
> > - fun->mtd.name = kasprintf(GFP_KERNEL, "%x.%s", io_res->start,
> > - flash_np->name);
> > + fun->mtd.name = kasprintf(GFP_KERNEL, "%x.%s",
> > + (unsigned int)io_res->start, flash_np->name);
>
> No, you should use %llx and (u64) cast since resourse_size_t can be
> anything up to u64.
You are right. unsigned long long should be used.
updated.
Thanks.
Roy
More information about the linux-mtd
mailing list