All of lore.kernel.org
 help / color / mirror / Atom feed
From: Boris Brezillon <boris.brezillon@bootlin.com>
To: Boris Brezillon <boris.brezillon@bootlin.com>,
	Richard Weinberger <richard@nod.at>,
	Miquel Raynal <miquel.raynal@bootlin.com>,
	linux-mtd@lists.infradead.org
Cc: 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: Mon, 5 Nov 2018 23:57:49 +0100	[thread overview]
Message-ID: <20181105235749.06fcdc6d@bbrezillon> (raw)
In-Reply-To: <20181028112955.26547-1-boris.brezillon@bootlin.com>

On Sun, 28 Oct 2018 12:29:55 +0100
Boris Brezillon <boris.brezillon@bootlin.com> wrote:

> 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>

Queued to the fixes branch.

> ---
>  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;
>  }
>  
>  /**

      parent reply	other threads:[~2018-11-05 22:58 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
2018-11-05 22:57 ` Boris Brezillon [this message]

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=20181105235749.06fcdc6d@bbrezillon \
    --to=boris.brezillon@bootlin.com \
    --cc=computersforpeace@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=marek.vasut@gmail.com \
    --cc=miquel.raynal@bootlin.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 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.