From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.nokia.com ([192.100.122.233] helo=mgw-mx06.nokia.com) by bombadil.infradead.org with esmtps (Exim 4.69 #1 (Red Hat Linux)) id 1NHz3D-0001Kn-Ll for linux-mtd@lists.infradead.org; Tue, 08 Dec 2009 12:20:24 +0000 Subject: Re: [RFC] [PATCH] [MTD-UTILS]: flash_lock: fix length being passed From: Artem Bityutskiy To: Vimal Singh In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Date: Tue, 08 Dec 2009 14:19:51 +0200 Message-Id: <1260274791.19669.48.camel@localhost> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Cc: Linux MTD Reply-To: dedekind1@gmail.com List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Wed, 2009-12-02 at 19:58 +0530, Vimal Singh wrote: > This patch fixes the 'length' calculation. > Making it: > + mtdLockInfo.length = (num_sectors - 1) * mtdInfo.erasesize; > Rather: > - mtdLockInfo.length = num_sectors * mtdInfo.erasesize; > > Say there are 240 blocks present in the device. Then: > offset starts from: 0x0 > and full size of device: 0x1E00000 > > doing: 240 * 0x20000 gives -> 0x1E00000 > But last block address should be 0x1DE0000 (which spans for 0x20000 > bytes, adding upto size of 0x1E00000) > > Signed-off-by: Vimal Singh Pushed, thanks! -- Best Regards, Artem Bityutskiy (Артём Битюцкий)