From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.bootlin.com ([62.4.15.54]) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gHrbd-0003jn-9z for linux-mtd@lists.infradead.org; Wed, 31 Oct 2018 14:36:29 +0000 Date: Wed, 31 Oct 2018 15:36:02 +0100 From: Miquel Raynal To: Boris Brezillon Cc: Richard Weinberger , linux-mtd@lists.infradead.org, David Woodhouse , Brian Norris , Marek Vasut , stable@vger.kernel.org Subject: Re: [PATCH] mtd: nand: Fix nanddev_neraseblocks() Message-ID: <20181031153602.7abe8825@xps13> In-Reply-To: <20181028112955.26547-1-boris.brezillon@bootlin.com> References: <20181028112955.26547-1-boris.brezillon@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Hi Boris, Boris Brezillon 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. >=20 > Fixes: 9c3736a3de21 ("mtd: nand: Add core infrastructure to deal with NAN= D devices") > Cc: > Signed-off-by: Boris Brezillon > --- > include/linux/mtd/nand.h | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) >=20 > 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 str= uct 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; > } > =20 > /** Reviewed-by: Miquel Raynal Thanks, Miqu=C3=A8l