hush/miscutils
Richard Genoud cbf3bfa57a nanddump: correct rounding to next page (lead to infinite loop)
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

modprobe nandsim parts="20,20" badblocks="22,23"

without patch:
nanddump  /dev/mtd1 | wc -c
[...] infinite loop

with the patch:
nanddump /dev/mtd1 | wc -c
327680

Signed-off-by: Richard Genoud <richard.genoud@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-06-25 16:37:37 +02:00
..
adjtimex.c adjtimex: make its help text and printed data a bit less cryptic 2014-04-17 11:29:34 +02:00
bbconfig.c rename archive.h to bb_archive.h. no code changes 2011-09-22 12:45:14 +02:00
beep.c *: remove "Options:" string from help texts 2011-06-05 03:58:28 +02:00
chat.c fix assorted unused code and wrong format specs found by cppchekc (bug 6716) 2013-11-29 16:43:33 +01:00
chrt.c chrt: remove warning for _POSIX_PRIORITY_SCHEDULING 2013-07-08 11:20:13 +02:00
Config.src crond: tweak help text, make course less cryptic 2014-04-30 14:47:28 +02:00
conspy.c conspy: add framebuffer support, -Q option. 2011-09-13 18:39:04 +02:00
crond.c crond: implement "SHELL=prog" in crontab. Export LOGNAME as POSIX wants 2014-04-30 17:38:27 +02:00
crontab.c wall,crontab: use xopen_as_uid_gid() 2013-10-08 14:53:29 +02:00
dc.c dc: code shrink 2013-01-18 13:30:13 +01:00
devfsd.c devfsd: remove static variable 2013-11-26 12:12:27 +01:00
devmem.c move remaining help text from include/usage.src.h 2011-04-11 03:29:49 +02:00
eject.c *: remove "Options:" string from help texts 2011-06-05 03:58:28 +02:00
fbsplash.c zcat: complain if input is not compressed 2014-02-02 02:06:38 +01:00
fbsplash.cfg
flash_eraseall.c flash_eraseall: implement -N 2013-03-15 00:42:39 +01:00
flash_lock_unlock.c move remaining help text from include/usage.src.h 2011-04-11 03:29:49 +02:00
flashcp.c flashcp: trivial code shrink 2013-01-28 12:26:29 +01:00
hdparm.c Use unsigned printf/scanf conversion where more appropriate 2013-11-29 16:45:45 +01:00
inotifyd.c inotify: if PROG is -, print events to stdout 2011-10-10 20:24:02 +02:00
ionice.c *: remove "Options:" string from help texts 2011-06-05 03:58:28 +02:00
Kbuild.src crond: tweak help text, make course less cryptic 2014-04-30 14:47:28 +02:00
last_fancy.c whitespace cleanup. no code changes 2013-01-14 15:57:44 +01:00
last.c whitespace fixes. no code changes 2013-01-14 01:34:48 +01:00
less.c Fix compile failures 2014-05-02 07:18:55 +02:00
makedevs.c makedevs: fix help-text 2011-05-30 23:00:47 +02:00
man.c man: default to ascii 2014-03-03 15:14:26 +01:00
microcom.c *: remove "Options:" string from help texts 2011-06-05 03:58:28 +02:00
mountpoint.c *: remove "Options:" string from help texts 2011-06-05 03:58:28 +02:00
mt.c move remaining help text from include/usage.src.h 2011-04-11 03:29:49 +02:00
nandwrite.c nanddump: correct rounding to next page (lead to infinite loop) 2014-06-25 16:37:37 +02:00
raidautorun.c move remaining help text from include/usage.src.h 2011-04-11 03:29:49 +02:00
readahead.c move remaining help text from include/usage.src.h 2011-04-11 03:29:49 +02:00
rfkill.c rfkill: use new-style config/kbuild/applet 2013-11-20 14:21:29 +01:00
runlevel.c whitespace fixes 2011-10-28 14:07:44 +02:00
rx.c whitespace fixes. no code changes 2013-01-15 13:58:01 +01:00
setserial.c setserial: Fix typo: s/baund_rate/baud_rate/g 2013-03-22 17:04:51 +01:00
setsid.c setsid: code shrink, expanded comments 2013-08-07 18:49:51 +02:00
strings.c *: remove "Options:" string from help texts 2011-06-05 03:58:28 +02:00
taskset.c *: remove "Options:" string from help texts 2011-06-05 03:58:28 +02:00
time.c whitespace fixes. no code changes 2013-01-15 13:58:01 +01:00
timeout.c move remaining help text from include/usage.src.h 2011-04-11 03:29:49 +02:00
ttysize.c move remaining help text from include/usage.src.h 2011-04-11 03:29:49 +02:00
ubi_tools.c ubi_tools: fix typo in strcpy 2013-08-04 21:07:20 +02:00
volname.c move remaining help text from include/usage.src.h 2011-04-11 03:29:49 +02:00
wall.c wall,crontab: use xopen_as_uid_gid() 2013-10-08 14:53:29 +02:00
watchdog.c CONFIG_PID_FILE_PATH: new configuration option for pidfile paths 2012-12-19 15:53:33 -05:00