From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Boris Brezillon <boris.brezillon@bootlin.com>
Cc: 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>,
stable@vger.kernel.org
Subject: Re: [PATCH] mtd: nand: Fix nanddev_neraseblocks()
Date: Wed, 31 Oct 2018 15:36:02 +0100 [thread overview]
Message-ID: <20181031153602.7abe8825@xps13> (raw)
In-Reply-To: <20181028112955.26547-1-boris.brezillon@bootlin.com>
Hi Boris,
Boris Brezillon <boris.brezillon@bootlin.com> wrote on Sun, 28 Oct 2018
12:29:55 +0100:
> nanddev_neraseblocks() currently returns the number pages per LUN
> instead of the total number of eraseblocks.
>
> Fixes: 9c3736a3de21 ("mtd: nand: Add core infrastructure to deal with NAND devices")
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
> ---
> include/linux/mtd/nand.h | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
> index abe975c87b90..78b86dea2f29 100644
> --- a/include/linux/mtd/nand.h
> +++ b/include/linux/mtd/nand.h
> @@ -324,9 +324,8 @@ static inline unsigned int nanddev_ntargets(const struct nand_device *nand)
> */
> static inline unsigned int nanddev_neraseblocks(const struct nand_device *nand)
> {
> - return (u64)nand->memorg.luns_per_target *
> - nand->memorg.eraseblocks_per_lun *
> - nand->memorg.pages_per_eraseblock;
> + return nand->memorg.ntargets * nand->memorg.luns_per_target *
> + nand->memorg.eraseblocks_per_lun;
> }
>
> /**
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Thanks,
Miquèl
next prev parent reply other threads:[~2018-10-31 14:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-28 11:29 [PATCH] mtd: nand: Fix nanddev_neraseblocks() Boris Brezillon
2018-10-31 14:36 ` Miquel Raynal [this message]
2018-11-05 22:57 ` Boris Brezillon
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=20181031153602.7abe8825@xps13 \
--to=miquel.raynal@bootlin.com \
--cc=boris.brezillon@bootlin.com \
--cc=computersforpeace@gmail.com \
--cc=dwmw2@infradead.org \
--cc=linux-mtd@lists.infradead.org \
--cc=marek.vasut@gmail.com \
--cc=richard@nod.at \
--cc=stable@vger.kernel.org \
/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).