kernel_optimize_test/drivers/mtd/tests
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
..
Makefile mtd: add nand_ecc test module 2009-11-30 09:41:49 +00:00
mtd_nandecctest.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
mtd_oobtest.c mtd: introduce mtd_block_isbad interface 2012-01-09 18:25:47 +00:00
mtd_pagetest.c mtd: remove extra retlen assignment 2012-01-09 18:25:56 +00:00
mtd_readtest.c mtd: remove extra retlen assignment 2012-01-09 18:25:56 +00:00
mtd_speedtest.c mtd: remove extra retlen assignment 2012-01-09 18:25:56 +00:00
mtd_stresstest.c mtd: remove extra retlen assignment 2012-01-09 18:25:56 +00:00
mtd_subpagetest.c mtd: remove extra retlen assignment 2012-01-09 18:25:56 +00:00
mtd_torturetest.c mtd: remove extra retlen assignment 2012-01-09 18:25:56 +00:00