* [PATCH] mtd: fix the build warning for fsl_upm.c
@ 2010-09-08 3:46 Roy Zang
2010-09-08 8:46 ` Artem Bityutskiy
0 siblings, 1 reply; 3+ messages in thread
From: Roy Zang @ 2010-09-08 3:46 UTC (permalink / raw)
To: linux-mtd; +Cc: akpm, dwmw2, cbouatmailru
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@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);
if (!fun->mtd.name) {
ret = -ENOMEM;
goto err;
--
1.5.6.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] mtd: fix the build warning for fsl_upm.c
2010-09-08 3:46 [PATCH] mtd: fix the build warning for fsl_upm.c Roy Zang
@ 2010-09-08 8:46 ` Artem Bityutskiy
2010-09-08 9:10 ` Zang Roy-R61911
0 siblings, 1 reply; 3+ messages in thread
From: Artem Bityutskiy @ 2010-09-08 8:46 UTC (permalink / raw)
To: Roy Zang; +Cc: dwmw2, akpm, linux-mtd, cbouatmailru
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@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.
--
Best Regards,
Artem Bityutskiy (Артём Битюцкий)
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [PATCH] mtd: fix the build warning for fsl_upm.c
2010-09-08 8:46 ` Artem Bityutskiy
@ 2010-09-08 9:10 ` Zang Roy-R61911
0 siblings, 0 replies; 3+ messages in thread
From: Zang Roy-R61911 @ 2010-09-08 9:10 UTC (permalink / raw)
To: dedekind1; +Cc: dwmw2, akpm, linux-mtd, cbouatmailru
> -----Original Message-----
> From: Artem Bityutskiy [mailto:dedekind1@gmail.com]
> Sent: Wednesday, September 08, 2010 16:46 PM
> To: Zang Roy-R61911
> Cc: linux-mtd@lists.infradead.org; akpm@linux-foundation.org;
> dwmw2@infradead.org; cbouatmailru@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@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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-09-08 9:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-08 3:46 [PATCH] mtd: fix the build warning for fsl_upm.c Roy Zang
2010-09-08 8:46 ` Artem Bityutskiy
2010-09-08 9:10 ` Zang Roy-R61911
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).