[RFC] [PATCH] [MTD-UTILS]: flash_lock: fix length being passed

Artem Bityutskiy dedekind1 at gmail.com
Tue Dec 8 07:19:51 EST 2009


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 <vimalsingh at ti.com>

Pushed, thanks!

-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)




More information about the linux-mtd mailing list