[PATCH] nanddump: correct rounding to next page

Richard Genoud richard.genoud at gmail.com
Thu Jun 19 15:55:28 UTC 2014


2014-06-18 15:44 GMT+02:00 Richard Genoud <richard.genoud at gmail.com>:
> The rounding to next page formula was wrong:
> ex: (len | ~(meminfo->writesize - 1)) + 1;
> len=128K
> writesize=4K
> (len | ~(meminfo->writesize - 1)) + 1 => 4 294 963 201 ?!
>
> correct rounding formula:
> ((len - 1) | (meminfo->writesize - 1)) + 1 => 128K
> len = 130K
> ((len - 1) | (meminfo->writesize - 1)) + 1 => 132K
>
> Signed-off-by: Richard Genoud <richard.genoud at gmail.com>
> ---

I'll resend this patch in the nanddump serie.


More information about the busybox mailing list