linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Boris Brezillon <boris.brezillon@bootlin.com>
To: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Miquel Raynal <miquel.raynal@bootlin.com>,
	Richard Weinberger <richard@nod.at>,
	linux-mtd@lists.infradead.org,
	David Woodhouse <dwmw2@infradead.org>,
	Brian Norris <computersforpeace@gmail.com>,
	Marek Vasut <marek.vasut@gmail.com>
Subject: Re: [PATCH] mtd: rawnand: jz4740: Use the proper format specifier to print chipnr
Date: Fri, 20 Jul 2018 08:23:25 +0200	[thread overview]
Message-ID: <20180720082325.5d7ae688@bbrezillon> (raw)
In-Reply-To: <20180720145628.6cd61fc6@canb.auug.org.au>

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

      reply	other threads:[~2018-07-20  6:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180720082325.5d7ae688@bbrezillon \
    --to=boris.brezillon@bootlin.com \
    --cc=computersforpeace@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=marek.vasut@gmail.com \
    --cc=miquel.raynal@bootlin.com \
    --cc=richard@nod.at \
    --cc=sfr@canb.auug.org.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).