All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Miquel Raynal <miquel.raynal@bootlin.com>
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:28:37 +0200	[thread overview]
Message-ID: <20190820082837.rvk2itycnka4vo6a@pengutronix.de> (raw)
In-Reply-To: <20190819101718.39b3a5ca@xps13>

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.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

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

  parent reply	other threads:[~2019-08-20  8:28 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 [this message]
2019-08-20  8:32     ` Miquel Raynal
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=20190820082837.rvk2itycnka4vo6a@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --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=miquel.raynal@bootlin.com \
    --cc=peterpandong@micron.com \
    --cc=richard@nod.at \
    /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.