linux/drivers/mtd
Artem Bityutskiy 30fa98480b mtd: remove extra retlen assignment
MTD functions always assign the 'retlen' argument to 0 at the very
beginning - the callers do not have to do this.

I used the following semantic patch to find these places:

@@
identifier retlen;
expression a, b, c, d, e;
constant C;
type T;
@@
(
- retlen = C;
|
T
-retlen = C
+ retlen
;
)

... when != retlen
    when exists

(
mtd_read(a, b, c, &retlen, d)
|
mtd_write(a, b, c, &retlen, d)
|
mtd_panic_write(a, b, c, &retlen, d)
|
mtd_point(a, b, c, &retlen, d, e)
|
mtd_read_fact_prot_reg(a, b, c, &retlen, d)
|
mtd_write_user_prot_reg(a, b, c, &retlen, d)
|
mtd_read_user_prot_reg(a, b, c, &retlen, d)
|
mtd_writev(a, b, c, d, &retlen)
)

I ran it twice, because there were cases of double zero assigments
in mtd tests. Then I went through the patch to verify that spatch
did not find any false positives.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
2012-01-09 18:25:56 +00:00
..
chips mtd: introduce mtd_write interface 2012-01-09 18:25:20 +00:00
devices mtd: doc: do not initialize mtd_info fields to 0 or NULL 2012-01-09 18:25:53 +00:00
lpddr mtd: lpddr: drop unnecessary zeroing 2012-01-09 18:24:48 +00:00
maps mtd: introduce mtd_resume interface 2012-01-09 18:25:46 +00:00
nand mtd: introduce mtd_block_markbad interface 2012-01-09 18:25:48 +00:00
onenand mtd: introduce mtd_block_markbad interface 2012-01-09 18:25:48 +00:00
tests mtd: remove extra retlen assignment 2012-01-09 18:25:56 +00:00
ubi mtd: introduce mtd_block_markbad interface 2012-01-09 18:25:48 +00:00
afs.c mtd: introduce mtd_read interface 2012-01-09 18:25:19 +00:00
ar7part.c mtd: introduce mtd_read interface 2012-01-09 18:25:19 +00:00
bcm63xxpart.c mtd: introduce mtd_read interface 2012-01-09 18:25:19 +00:00
cmdlinepart.c Merge git://git.infradead.org/mtd-2.6 2011-11-07 09:11:16 -08:00
ftl.c mtd: introduce mtd_sync interface 2012-01-09 18:25:35 +00:00
inftlcore.c mtd: introduce mtd_write_oob interface 2012-01-09 18:25:24 +00:00
inftlmount.c mtd: introduce mtd_block_markbad interface 2012-01-09 18:25:48 +00:00
Kconfig mtd: maps: bcm963xx-flash: make CFE partition parsing an mtd parser 2012-01-09 18:15:31 +00:00
Makefile mtd: maps: bcm963xx-flash: make CFE partition parsing an mtd parser 2012-01-09 18:15:31 +00:00
mtd_blkdevs.c mtd: mtd_blkdevs: don't increase 'open' count on error path 2012-01-09 18:04:01 +00:00
mtdblock_ro.c mtd: introduce mtd_write interface 2012-01-09 18:25:20 +00:00
mtdblock.c mtd: introduce mtd_sync interface 2012-01-09 18:25:35 +00:00
mtdchar.c mtd: remove extra retlen assignment 2012-01-09 18:25:56 +00:00
mtdconcat.c mtd: introduce mtd_block_markbad interface 2012-01-09 18:25:48 +00:00
mtdcore.c mtd: introduce mtd_resume interface 2012-01-09 18:25:46 +00:00
mtdcore.h mtd: hide parse_mtd_partitions 2011-09-11 15:02:13 +03:00
mtdoops.c mtd: introduce mtd_block_markbad interface 2012-01-09 18:25:48 +00:00
mtdpart.c mtd: introduce mtd_block_markbad interface 2012-01-09 18:25:48 +00:00
mtdsuper.c Merge git://git.infradead.org/mtd-2.6 2011-11-07 09:11:16 -08:00
mtdswap.c mtd: introduce mtd_block_markbad interface 2012-01-09 18:25:48 +00:00
nftlcore.c mtd: introduce mtd_write_oob interface 2012-01-09 18:25:24 +00:00
nftlmount.c mtd: introduce mtd_block_markbad interface 2012-01-09 18:25:48 +00:00
ofpart.c mtd: ofpart: add ofoldpart alias 2011-09-11 15:02:14 +03:00
redboot.c mtd: introduce mtd_block_isbad interface 2012-01-09 18:25:47 +00:00
rfd_ftl.c mtd: introduce mtd_sync interface 2012-01-09 18:25:35 +00:00
sm_ftl.c mtd: introduce mtd_write_oob interface 2012-01-09 18:25:24 +00:00
sm_ftl.h mtd: sm_ftl: cosmetic, use bool when possible 2010-10-25 01:33:08 +01:00
ssfdc.c mtd: introduce mtd_block_isbad interface 2012-01-09 18:25:47 +00:00