From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.bootlin.com ([62.4.15.54]:59023 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388222AbeKFIUD (ORCPT ); Tue, 6 Nov 2018 03:20:03 -0500 Date: Mon, 5 Nov 2018 23:57:49 +0100 From: Boris Brezillon To: Boris Brezillon , Richard Weinberger , Miquel Raynal , linux-mtd@lists.infradead.org Cc: David Woodhouse , Brian Norris , Marek Vasut , stable@vger.kernel.org Subject: Re: [PATCH] mtd: nand: Fix nanddev_neraseblocks() Message-ID: <20181105235749.06fcdc6d@bbrezillon> 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=US-ASCII Content-Transfer-Encoding: 7bit Sender: stable-owner@vger.kernel.org List-ID: On Sun, 28 Oct 2018 12:29:55 +0100 Boris Brezillon 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: > Signed-off-by: Boris Brezillon 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; > } > > /**