All of lore.kernel.org
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: bbrezillon@kernel.org, richard@nod.at,
	Marco Felsch <m.felsch@pengutronix.de>,
	frieder.schrempf@kontron.de, marek.vasut@gmail.com,
	linux-mtd@lists.infradead.org, kernel@pengutronix.de,
	Peter Pan <peterpandong@micron.com>
Subject: Re: [PATCH] mtd: spinand: micron: add support for MT29F1G01AAADD
Date: Tue, 20 Aug 2019 10:32:53 +0200	[thread overview]
Message-ID: <20190820103253.090f88ee@xps13> (raw)
In-Reply-To: <20190820082837.rvk2itycnka4vo6a@pengutronix.de>

Hi Uwe,

Uwe Kleine-König <u.kleine-koenig@pengutronix.de> wrote on Tue, 20 Aug
2019 10:28:37 +0200:

> Hello Miquèl,
> 
> On Mon, Aug 19, 2019 at 10:17:18AM +0200, Miquel Raynal wrote:
> > Marco Felsch <m.felsch@pengutronix.de> wrote on Wed, 14 Aug 2019
> > 10:22:32 +0200:  
> > > +static int mt29f1g01aaadd_ooblayout_ecc(struct mtd_info *mtd, int section,
> > > +					struct mtd_oob_region *region)
> > > +{
> > > +	if (section > 3)
> > > +		return -ERANGE;
> > > +
> > > +	region->offset = (section * 0x10) + 8;  
> > 
> > Any reason to use hex here?         ^
> > 
> > If not I would prefer decimal numbers.  
> 
> IMHO it is quite common to use hexadecimal also for register offsets,
> not only for register values.
> 
> I checked a few drivers (drivers/mtd/nand/raw/mxc_nand.c,
> drivers/clk/meson/g12a.c, drivers/gpio/gpio-sch.c) and they all use hex
> also for the offsets, so it seems to be at least usual. Also as offsets
> for repeating registers are usually powers of two, hexadecimal constants
> are more suitable IMHO.

Absolutely. But here region->offset is not a register offset at all, it
is an indication for the upper layers of the position of an area within
a bigger buffer (here: where are the ECC bytes in my buffer in RAM). I
don't think hexadecimal numbers have any interest here.

Thanks,
Miquèl

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

  reply	other threads:[~2019-08-20  8:33 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-14  8:22 [PATCH] mtd: spinand: micron: add support for MT29F1G01AAADD Marco Felsch
2019-08-19  8:17 ` Miquel Raynal
2019-08-19 13:30   ` Marco Felsch
2019-08-19 14:34     ` Miquel Raynal
2019-08-20  6:39       ` Marco Felsch
2019-08-20 11:31         ` [EXT] " Shivamurthy Shastri (sshivamurthy)
2019-08-20 11:33           ` Shivamurthy Shastri (sshivamurthy)
2019-08-21  7:19             ` Marco Felsch
2019-08-24 10:40               ` Miquel Raynal
2019-08-20 11:35           ` Marco Felsch
2019-08-20  8:28   ` Uwe Kleine-König
2019-08-20  8:32     ` Miquel Raynal [this message]
2019-11-08  7:48 Marco Felsch

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=20190820103253.090f88ee@xps13 \
    --to=miquel.raynal@bootlin.com \
    --cc=bbrezillon@kernel.org \
    --cc=frieder.schrempf@kontron.de \
    --cc=kernel@pengutronix.de \
    --cc=linux-mtd@lists.infradead.org \
    --cc=m.felsch@pengutronix.de \
    --cc=marek.vasut@gmail.com \
    --cc=peterpandong@micron.com \
    --cc=richard@nod.at \
    --cc=u.kleine-koenig@pengutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.