From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pb0-f54.google.com ([209.85.160.54]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UG8D2-0006ud-8a for linux-mtd@lists.infradead.org; Thu, 14 Mar 2013 13:28:41 +0000 Received: by mail-pb0-f54.google.com with SMTP id rr4so2216892pbb.13 for ; Thu, 14 Mar 2013 06:28:38 -0700 (PDT) Message-ID: <5142884C.9090206@gmail.com> Date: Thu, 14 Mar 2013 22:32:44 -0400 From: Huang Shijie MIME-Version: 1.0 To: Artem Bityutskiy Subject: Re: [PATCH] mtd: introduce a macro for max NAND ID sequence length References: <1363247938-2915-1-git-send-email-dedekind1@gmail.com> In-Reply-To: <1363247938-2915-1-git-send-email-dedekind1@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Cc: Huang Shijie , MTD Maling List List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 于 2013年03月14日 03:58, Artem Bityutskiy 写道: > From: Artem Bityutskiy > > Introduce a helpful macro for the maximum NAND ID sequence length instead of > using the "8" magic number. > > Signed-off-by: Artem Bityutskiy > --- > include/linux/mtd/nand.h | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h > index e2c7173..33516eb 100644 > --- a/include/linux/mtd/nand.h > +++ b/include/linux/mtd/nand.h > @@ -542,6 +542,9 @@ struct nand_chip { > #define NAND_MFR_MACRONIX 0xc2 > #define NAND_MFR_EON 0x92 > > +/* The maximum expected count of bytes in the NAND ID sequence */ > +#define NAND_MAX_ID_LEN 8 > + > /* > * A helper for defining older NAND chips where the second ID byte fully > * defined the chip, including the geometry (chip size, eraseblock size, page > @@ -589,7 +592,7 @@ struct nand_flash_dev { > uint8_t mfr_id; > uint8_t dev_id; > }; > - uint8_t id[8]; > + uint8_t id[NAND_MAX_ID_LEN]; > }; > unsigned int pagesize; > unsigned int chipsize; I also thought we should add a macro for the length of the id data. Acked-by: Huang Shijie