[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20151208094358.2be0f191@bbrezillon>
Date: Tue, 8 Dec 2015 09:43:58 +0100
From: Boris Brezillon <boris.brezillon@...e-electrons.com>
To: Julian Calaby <julian.calaby@...il.com>
Cc: David Woodhouse <dwmw2@...radead.org>,
Brian Norris <computersforpeace@...il.com>,
linux-mtd@...ts.infradead.org, Daniel Mack <daniel@...que.org>,
Haojian Zhuang <haojian.zhuang@...il.com>,
Robert Jarzmik <robert.jarzmik@...e.fr>,
Kukjin Kim <kgene@...nel.org>,
Krzysztof Kozlowski <k.kozlowski@...sung.com>,
linux-samsung-soc@...r.kernel.org,
"Mailing List, Arm" <linux-arm-kernel@...ts.infradead.org>,
Ralf Baechle <ralf@...ux-mips.org>, linux-mips@...ux-mips.org,
Josh Wu <josh.wu@...el.com>,
Ezequiel Garcia <ezequiel.garcia@...e-electrons.com>,
Maxime Ripard <maxime.ripard@...e-electrons.com>,
Chen-Yu Tsai <wens@...e.org>,
linux-sunxi <linux-sunxi@...glegroups.com>,
Stefan Agner <stefan@...er.ch>,
Kyungmin Park <kyungmin.park@...sung.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"devel@...verdev.osuosl.org" <devel@...verdev.osuosl.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
punnaiah choudary kalluri <punnaia@...inx.com>
Subject: Re: [linux-sunxi] [PATCH 21/23] staging: mt29f_spinand: switch to
mtd_ooblayout_ops
Hi Julian,
On Tue, 8 Dec 2015 10:59:53 +1100
Julian Calaby <julian.calaby@...il.com> wrote:
> Hi Boris,
>
> On Tue, Dec 8, 2015 at 9:26 AM, Boris Brezillon
> <boris.brezillon@...e-electrons.com> wrote:
> > Signed-off-by: Boris Brezillon <boris.brezillon@...e-electrons.com>
> > ---
> > drivers/staging/mt29f_spinand/mt29f_spinand.c | 44 ++++++++++++++++-----------
> > 1 file changed, 26 insertions(+), 18 deletions(-)
> >
> > diff --git a/drivers/staging/mt29f_spinand/mt29f_spinand.c b/drivers/staging/mt29f_spinand/mt29f_spinand.c
> > index cb9d5ab..967d50a 100644
> > --- a/drivers/staging/mt29f_spinand/mt29f_spinand.c
> > +++ b/drivers/staging/mt29f_spinand/mt29f_spinand.c
> > @@ -42,23 +42,29 @@ static inline struct spinand_state *mtd_to_state(struct mtd_info *mtd)
> > static int enable_hw_ecc;
> > static int enable_read_hw_ecc;
> >
> > -static struct nand_ecclayout spinand_oob_64 = {
> > - .eccbytes = 24,
> > - .eccpos = {
> > - 1, 2, 3, 4, 5, 6,
> > - 17, 18, 19, 20, 21, 22,
> > - 33, 34, 35, 36, 37, 38,
> > - 49, 50, 51, 52, 53, 54, },
> > - .oobfree = {
> > - {.offset = 8,
> > - .length = 8},
> > - {.offset = 24,
> > - .length = 8},
> > - {.offset = 40,
> > - .length = 8},
> > - {.offset = 56,
> > - .length = 8},
> > - }
> > +static int spinand_oob_64_eccpos(struct mtd_info *mtd, int eccbyte)
> > +{
> > + if (eccbyte > 23)
> > + return -ERANGE;
> > +
> > + return ((eccbyte / 6) * 16) + 1;
>
> Are you sure this is correct? My reading of this is that we'd get 1
> for eccbytes 0 through 5.
>
> Would
>
> ((eccbyte / 6) * 16) + (eccbyte % 6) + 1
>
> be more correct?
Absolutely. I'll fix that.
Thanks,
Boris
--
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists