linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mtd: rawnand: jz4740: Use the proper format specifier to print chipnr
@ 2018-07-19  7:37 Boris Brezillon
  2018-07-19  7:41 ` Miquel Raynal
  2018-07-19 21:11 ` Miquel Raynal
  0 siblings, 2 replies; 5+ messages in thread
From: Boris Brezillon @ 2018-07-19  7:37 UTC (permalink / raw)
  To: Boris Brezillon, Richard Weinberger, Miquel Raynal, linux-mtd
  Cc: David Woodhouse, Brian Norris, Marek Vasut, Stephen Rothwell

In jz_nand_detect_bank(), chipnr is a size_t argument. Use %zu instead
of %i when printing it.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
---
 drivers/mtd/nand/raw/jz4740_nand.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/raw/jz4740_nand.c b/drivers/mtd/nand/raw/jz4740_nand.c
index 1f7aff04ad8a..9bb8a89e09f9 100644
--- a/drivers/mtd/nand/raw/jz4740_nand.c
+++ b/drivers/mtd/nand/raw/jz4740_nand.c
@@ -355,7 +355,7 @@ static int jz_nand_detect_bank(struct platform_device *pdev,
 		mtd->size += chip->chipsize;
 	}
 
-	dev_info(&pdev->dev, "Found chip %i on bank %i\n", chipnr, bank);
+	dev_info(&pdev->dev, "Found chip %zu on bank %i\n", chipnr, bank);
 	return 0;
 
 notfound_id:
-- 
2.14.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] mtd: rawnand: jz4740: Use the proper format specifier to print chipnr
  2018-07-19  7:37 [PATCH] mtd: rawnand: jz4740: Use the proper format specifier to print chipnr Boris Brezillon
@ 2018-07-19  7:41 ` Miquel Raynal
  2018-07-19 21:11 ` Miquel Raynal
  1 sibling, 0 replies; 5+ messages in thread
From: Miquel Raynal @ 2018-07-19  7:41 UTC (permalink / raw)
  To: Boris Brezillon
  Cc: Richard Weinberger, linux-mtd, David Woodhouse, Brian Norris,
	Marek Vasut, Stephen Rothwell

Hi Boris,

Boris Brezillon <boris.brezillon@bootlin.com> wrote on Thu, 19 Jul 2018
09:37:20 +0200:

> In jz_nand_detect_bank(), chipnr is a size_t argument. Use %zu instead
> of %i when printing it.
> 
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
> ---

Thanks for fixing Stephen build warning report, I'll apply this patch
before the patch adding COMPILE_TEST for the jz4740 driver.

Miquèl

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] mtd: rawnand: jz4740: Use the proper format specifier to print chipnr
  2018-07-19  7:37 [PATCH] mtd: rawnand: jz4740: Use the proper format specifier to print chipnr Boris Brezillon
  2018-07-19  7:41 ` Miquel Raynal
@ 2018-07-19 21:11 ` Miquel Raynal
  2018-07-20  4:56   ` Stephen Rothwell
  1 sibling, 1 reply; 5+ messages in thread
From: Miquel Raynal @ 2018-07-19 21:11 UTC (permalink / raw)
  To: Boris Brezillon
  Cc: Richard Weinberger, linux-mtd, David Woodhouse, Brian Norris,
	Marek Vasut, Stephen Rothwell

Hi Boris,

Boris Brezillon <boris.brezillon@bootlin.com> wrote on Thu, 19 Jul 2018
09:37:20 +0200:

> In jz_nand_detect_bank(), chipnr is a size_t argument. Use %zu instead
> of %i when printing it.
> 
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
> ---
>  drivers/mtd/nand/raw/jz4740_nand.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mtd/nand/raw/jz4740_nand.c b/drivers/mtd/nand/raw/jz4740_nand.c
> index 1f7aff04ad8a..9bb8a89e09f9 100644
> --- a/drivers/mtd/nand/raw/jz4740_nand.c
> +++ b/drivers/mtd/nand/raw/jz4740_nand.c
> @@ -355,7 +355,7 @@ static int jz_nand_detect_bank(struct platform_device *pdev,
>  		mtd->size += chip->chipsize;
>  	}
>  
> -	dev_info(&pdev->dev, "Found chip %i on bank %i\n", chipnr, bank);
> +	dev_info(&pdev->dev, "Found chip %zu on bank %i\n", chipnr, bank);
>  	return 0;
>  
>  notfound_id:

Applied to nand/next.

Thanks,
Miquèl

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] mtd: rawnand: jz4740: Use the proper format specifier to print chipnr
  2018-07-19 21:11 ` Miquel Raynal
@ 2018-07-20  4:56   ` Stephen Rothwell
  2018-07-20  6:23     ` Boris Brezillon
  0 siblings, 1 reply; 5+ messages in thread
From: Stephen Rothwell @ 2018-07-20  4:56 UTC (permalink / raw)
  To: Miquel Raynal
  Cc: Boris Brezillon, Richard Weinberger, linux-mtd, David Woodhouse,
	Brian Norris, Marek Vasut

[-- Attachment #1: Type: text/plain, Size: 1297 bytes --]

Hi all,

On Thu, 19 Jul 2018 23:11:56 +0200 Miquel Raynal <miquel.raynal@bootlin.com> wrote:
>
> Boris Brezillon <boris.brezillon@bootlin.com> wrote on Thu, 19 Jul 2018
> 09:37:20 +0200:
> 
> > In jz_nand_detect_bank(), chipnr is a size_t argument. Use %zu instead
> > of %i when printing it.
> > 
> > Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> > Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
> > ---
> >  drivers/mtd/nand/raw/jz4740_nand.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/mtd/nand/raw/jz4740_nand.c b/drivers/mtd/nand/raw/jz4740_nand.c
> > index 1f7aff04ad8a..9bb8a89e09f9 100644
> > --- a/drivers/mtd/nand/raw/jz4740_nand.c
> > +++ b/drivers/mtd/nand/raw/jz4740_nand.c
> > @@ -355,7 +355,7 @@ static int jz_nand_detect_bank(struct platform_device *pdev,
> >  		mtd->size += chip->chipsize;
> >  	}
> >  
> > -	dev_info(&pdev->dev, "Found chip %i on bank %i\n", chipnr, bank);
> > +	dev_info(&pdev->dev, "Found chip %zu on bank %i\n", chipnr, bank);
> >  	return 0;
> >  
> >  notfound_id:  
> 
> Applied to nand/next.

It might be a better fix to ask why chipnr is a size_t at all ... it is
only used as an index, so should probably be int ...

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] mtd: rawnand: jz4740: Use the proper format specifier to print chipnr
  2018-07-20  4:56   ` Stephen Rothwell
@ 2018-07-20  6:23     ` Boris Brezillon
  0 siblings, 0 replies; 5+ messages in thread
From: Boris Brezillon @ 2018-07-20  6:23 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Miquel Raynal, Richard Weinberger, linux-mtd, David Woodhouse,
	Brian Norris, Marek Vasut

On Fri, 20 Jul 2018 14:56:28 +1000
Stephen Rothwell <sfr@canb.auug.org.au> wrote:

> Hi all,
> 
> On Thu, 19 Jul 2018 23:11:56 +0200 Miquel Raynal <miquel.raynal@bootlin.com> wrote:
> >
> > Boris Brezillon <boris.brezillon@bootlin.com> wrote on Thu, 19 Jul 2018
> > 09:37:20 +0200:
> >   
> > > In jz_nand_detect_bank(), chipnr is a size_t argument. Use %zu instead
> > > of %i when printing it.
> > > 
> > > Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> > > Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
> > > ---
> > >  drivers/mtd/nand/raw/jz4740_nand.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > diff --git a/drivers/mtd/nand/raw/jz4740_nand.c b/drivers/mtd/nand/raw/jz4740_nand.c
> > > index 1f7aff04ad8a..9bb8a89e09f9 100644
> > > --- a/drivers/mtd/nand/raw/jz4740_nand.c
> > > +++ b/drivers/mtd/nand/raw/jz4740_nand.c
> > > @@ -355,7 +355,7 @@ static int jz_nand_detect_bank(struct platform_device *pdev,
> > >  		mtd->size += chip->chipsize;
> > >  	}
> > >  
> > > -	dev_info(&pdev->dev, "Found chip %i on bank %i\n", chipnr, bank);
> > > +	dev_info(&pdev->dev, "Found chip %zu on bank %i\n", chipnr, bank);
> > >  	return 0;
> > >  
> > >  notfound_id:    
> > 
> > Applied to nand/next.  
> 
> It might be a better fix to ask why chipnr is a size_t at all ... it is
> only used as an index, so should probably be int ...

I considered this option, and then I had a look at the rest of the file
and found a few other places where size_t could be replaced by an
unsigned int, so I just gave up on this solution and went for the
one-liner changing the format specifier :-).

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-07-20  6:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-19  7:37 [PATCH] mtd: rawnand: jz4740: Use the proper format specifier to print chipnr Boris Brezillon
2018-07-19  7:41 ` Miquel Raynal
2018-07-19 21:11 ` Miquel Raynal
2018-07-20  4:56   ` Stephen Rothwell
2018-07-20  6:23     ` Boris Brezillon

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).