diff options
author | Hannes Eder <hannes@hanneseder.net> | 2009-03-05 14:15:01 -0500 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2009-03-30 09:22:04 -0400 |
commit | 23d42494915d4dbdf99bccd35a76f3d45fbed62e (patch) | |
tree | 8403a58885cdb95bb889688def72eedb8ff1ab09 | |
parent | 9c12bd8601a505d10fb5a93fed59a973088cbb85 (diff) |
trivial: NULL noise: drivers/mtd/tests/mtd_*test.c
Fix this sparse warnings:
drivers/mtd/tests/mtd_oobtest.c:139:33: warning: Using plain integer as NULL pointer
drivers/mtd/tests/mtd_oobtest.c:192:33: warning: Using plain integer as NULL pointer
drivers/mtd/tests/mtd_oobtest.c:219:41: warning: Using plain integer as NULL pointer
drivers/mtd/tests/mtd_oobtest.c:284:25: warning: Using plain integer as NULL pointer
drivers/mtd/tests/mtd_oobtest.c:525:25: warning: Using plain integer as NULL pointer
drivers/mtd/tests/mtd_oobtest.c:545:25: warning: Using plain integer as NULL pointer
drivers/mtd/tests/mtd_oobtest.c:569:33: warning: Using plain integer as NULL pointer
drivers/mtd/tests/mtd_oobtest.c:589:33: warning: Using plain integer as NULL pointer
drivers/mtd/tests/mtd_oobtest.c:613:33: warning: Using plain integer as NULL pointer
drivers/mtd/tests/mtd_oobtest.c:633:33: warning: Using plain integer as NULL pointer
drivers/mtd/tests/mtd_oobtest.c:673:41: warning: Using plain integer as NULL pointer
drivers/mtd/tests/mtd_oobtest.c:701:33: warning: Using plain integer as NULL pointer
drivers/mtd/tests/mtd_readtest.c:74:41: warning: Using plain integer as NULL pointer
Signed-off-by: Hannes Eder <hannes@hanneseder.net>
Acked-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
-rw-r--r-- | drivers/mtd/tests/mtd_oobtest.c | 24 | ||||
-rw-r--r-- | drivers/mtd/tests/mtd_readtest.c | 2 |
2 files changed, 13 insertions, 13 deletions
diff --git a/drivers/mtd/tests/mtd_oobtest.c b/drivers/mtd/tests/mtd_oobtest.c index afbc3f8126db..a18e8d2f2557 100644 --- a/drivers/mtd/tests/mtd_oobtest.c +++ b/drivers/mtd/tests/mtd_oobtest.c | |||
@@ -136,7 +136,7 @@ static int write_eraseblock(int ebnum) | |||
136 | ops.ooblen = use_len; | 136 | ops.ooblen = use_len; |
137 | ops.oobretlen = 0; | 137 | ops.oobretlen = 0; |
138 | ops.ooboffs = use_offset; | 138 | ops.ooboffs = use_offset; |
139 | ops.datbuf = 0; | 139 | ops.datbuf = NULL; |
140 | ops.oobbuf = writebuf; | 140 | ops.oobbuf = writebuf; |
141 | err = mtd->write_oob(mtd, addr, &ops); | 141 | err = mtd->write_oob(mtd, addr, &ops); |
142 | if (err || ops.oobretlen != use_len) { | 142 | if (err || ops.oobretlen != use_len) { |
@@ -189,7 +189,7 @@ static int verify_eraseblock(int ebnum) | |||
189 | ops.ooblen = use_len; | 189 | ops.ooblen = use_len; |
190 | ops.oobretlen = 0; | 190 | ops.oobretlen = 0; |
191 | ops.ooboffs = use_offset; | 191 | ops.ooboffs = use_offset; |
192 | ops.datbuf = 0; | 192 | ops.datbuf = NULL; |
193 | ops.oobbuf = readbuf; | 193 | ops.oobbuf = readbuf; |
194 | err = mtd->read_oob(mtd, addr, &ops); | 194 | err = mtd->read_oob(mtd, addr, &ops); |
195 | if (err || ops.oobretlen != use_len) { | 195 | if (err || ops.oobretlen != use_len) { |
@@ -216,7 +216,7 @@ static int verify_eraseblock(int ebnum) | |||
216 | ops.ooblen = mtd->ecclayout->oobavail; | 216 | ops.ooblen = mtd->ecclayout->oobavail; |
217 | ops.oobretlen = 0; | 217 | ops.oobretlen = 0; |
218 | ops.ooboffs = 0; | 218 | ops.ooboffs = 0; |
219 | ops.datbuf = 0; | 219 | ops.datbuf = NULL; |
220 | ops.oobbuf = readbuf; | 220 | ops.oobbuf = readbuf; |
221 | err = mtd->read_oob(mtd, addr, &ops); | 221 | err = mtd->read_oob(mtd, addr, &ops); |
222 | if (err || ops.oobretlen != mtd->ecclayout->oobavail) { | 222 | if (err || ops.oobretlen != mtd->ecclayout->oobavail) { |
@@ -281,7 +281,7 @@ static int verify_eraseblock_in_one_go(int ebnum) | |||
281 | ops.ooblen = len; | 281 | ops.ooblen = len; |
282 | ops.oobretlen = 0; | 282 | ops.oobretlen = 0; |
283 | ops.ooboffs = 0; | 283 | ops.ooboffs = 0; |
284 | ops.datbuf = 0; | 284 | ops.datbuf = NULL; |
285 | ops.oobbuf = readbuf; | 285 | ops.oobbuf = readbuf; |
286 | err = mtd->read_oob(mtd, addr, &ops); | 286 | err = mtd->read_oob(mtd, addr, &ops); |
287 | if (err || ops.oobretlen != len) { | 287 | if (err || ops.oobretlen != len) { |
@@ -522,7 +522,7 @@ static int __init mtd_oobtest_init(void) | |||
522 | ops.ooblen = 1; | 522 | ops.ooblen = 1; |
523 | ops.oobretlen = 0; | 523 | ops.oobretlen = 0; |
524 | ops.ooboffs = mtd->ecclayout->oobavail; | 524 | ops.ooboffs = mtd->ecclayout->oobavail; |
525 | ops.datbuf = 0; | 525 | ops.datbuf = NULL; |
526 | ops.oobbuf = writebuf; | 526 | ops.oobbuf = writebuf; |
527 | printk(PRINT_PREF "attempting to start write past end of OOB\n"); | 527 | printk(PRINT_PREF "attempting to start write past end of OOB\n"); |
528 | printk(PRINT_PREF "an error is expected...\n"); | 528 | printk(PRINT_PREF "an error is expected...\n"); |
@@ -542,7 +542,7 @@ static int __init mtd_oobtest_init(void) | |||
542 | ops.ooblen = 1; | 542 | ops.ooblen = 1; |
543 | ops.oobretlen = 0; | 543 | ops.oobretlen = 0; |
544 | ops.ooboffs = mtd->ecclayout->oobavail; | 544 | ops.ooboffs = mtd->ecclayout->oobavail; |
545 | ops.datbuf = 0; | 545 | ops.datbuf = NULL; |
546 | ops.oobbuf = readbuf; | 546 | ops.oobbuf = readbuf; |
547 | printk(PRINT_PREF "attempting to start read past end of OOB\n"); | 547 | printk(PRINT_PREF "attempting to start read past end of OOB\n"); |
548 | printk(PRINT_PREF "an error is expected...\n"); | 548 | printk(PRINT_PREF "an error is expected...\n"); |
@@ -566,7 +566,7 @@ static int __init mtd_oobtest_init(void) | |||
566 | ops.ooblen = mtd->ecclayout->oobavail + 1; | 566 | ops.ooblen = mtd->ecclayout->oobavail + 1; |
567 | ops.oobretlen = 0; | 567 | ops.oobretlen = 0; |
568 | ops.ooboffs = 0; | 568 | ops.ooboffs = 0; |
569 | ops.datbuf = 0; | 569 | ops.datbuf = NULL; |
570 | ops.oobbuf = writebuf; | 570 | ops.oobbuf = writebuf; |
571 | printk(PRINT_PREF "attempting to write past end of device\n"); | 571 | printk(PRINT_PREF "attempting to write past end of device\n"); |
572 | printk(PRINT_PREF "an error is expected...\n"); | 572 | printk(PRINT_PREF "an error is expected...\n"); |
@@ -586,7 +586,7 @@ static int __init mtd_oobtest_init(void) | |||
586 | ops.ooblen = mtd->ecclayout->oobavail + 1; | 586 | ops.ooblen = mtd->ecclayout->oobavail + 1; |
587 | ops.oobretlen = 0; | 587 | ops.oobretlen = 0; |
588 | ops.ooboffs = 0; | 588 | ops.ooboffs = 0; |
589 | ops.datbuf = 0; | 589 | ops.datbuf = NULL; |
590 | ops.oobbuf = readbuf; | 590 | ops.oobbuf = readbuf; |
591 | printk(PRINT_PREF "attempting to read past end of device\n"); | 591 | printk(PRINT_PREF "attempting to read past end of device\n"); |
592 | printk(PRINT_PREF "an error is expected...\n"); | 592 | printk(PRINT_PREF "an error is expected...\n"); |
@@ -610,7 +610,7 @@ static int __init mtd_oobtest_init(void) | |||
610 | ops.ooblen = mtd->ecclayout->oobavail; | 610 | ops.ooblen = mtd->ecclayout->oobavail; |
611 | ops.oobretlen = 0; | 611 | ops.oobretlen = 0; |
612 | ops.ooboffs = 1; | 612 | ops.ooboffs = 1; |
613 | ops.datbuf = 0; | 613 | ops.datbuf = NULL; |
614 | ops.oobbuf = writebuf; | 614 | ops.oobbuf = writebuf; |
615 | printk(PRINT_PREF "attempting to write past end of device\n"); | 615 | printk(PRINT_PREF "attempting to write past end of device\n"); |
616 | printk(PRINT_PREF "an error is expected...\n"); | 616 | printk(PRINT_PREF "an error is expected...\n"); |
@@ -630,7 +630,7 @@ static int __init mtd_oobtest_init(void) | |||
630 | ops.ooblen = mtd->ecclayout->oobavail; | 630 | ops.ooblen = mtd->ecclayout->oobavail; |
631 | ops.oobretlen = 0; | 631 | ops.oobretlen = 0; |
632 | ops.ooboffs = 1; | 632 | ops.ooboffs = 1; |
633 | ops.datbuf = 0; | 633 | ops.datbuf = NULL; |
634 | ops.oobbuf = readbuf; | 634 | ops.oobbuf = readbuf; |
635 | printk(PRINT_PREF "attempting to read past end of device\n"); | 635 | printk(PRINT_PREF "attempting to read past end of device\n"); |
636 | printk(PRINT_PREF "an error is expected...\n"); | 636 | printk(PRINT_PREF "an error is expected...\n"); |
@@ -670,7 +670,7 @@ static int __init mtd_oobtest_init(void) | |||
670 | ops.ooblen = sz; | 670 | ops.ooblen = sz; |
671 | ops.oobretlen = 0; | 671 | ops.oobretlen = 0; |
672 | ops.ooboffs = 0; | 672 | ops.ooboffs = 0; |
673 | ops.datbuf = 0; | 673 | ops.datbuf = NULL; |
674 | ops.oobbuf = writebuf; | 674 | ops.oobbuf = writebuf; |
675 | err = mtd->write_oob(mtd, addr, &ops); | 675 | err = mtd->write_oob(mtd, addr, &ops); |
676 | if (err) | 676 | if (err) |
@@ -698,7 +698,7 @@ static int __init mtd_oobtest_init(void) | |||
698 | ops.ooblen = mtd->ecclayout->oobavail * 2; | 698 | ops.ooblen = mtd->ecclayout->oobavail * 2; |
699 | ops.oobretlen = 0; | 699 | ops.oobretlen = 0; |
700 | ops.ooboffs = 0; | 700 | ops.ooboffs = 0; |
701 | ops.datbuf = 0; | 701 | ops.datbuf = NULL; |
702 | ops.oobbuf = readbuf; | 702 | ops.oobbuf = readbuf; |
703 | err = mtd->read_oob(mtd, addr, &ops); | 703 | err = mtd->read_oob(mtd, addr, &ops); |
704 | if (err) | 704 | if (err) |
diff --git a/drivers/mtd/tests/mtd_readtest.c b/drivers/mtd/tests/mtd_readtest.c index 645e77fdc63d..79fc4530987b 100644 --- a/drivers/mtd/tests/mtd_readtest.c +++ b/drivers/mtd/tests/mtd_readtest.c | |||
@@ -71,7 +71,7 @@ static int read_eraseblock_by_page(int ebnum) | |||
71 | ops.ooblen = mtd->oobsize; | 71 | ops.ooblen = mtd->oobsize; |
72 | ops.oobretlen = 0; | 72 | ops.oobretlen = 0; |
73 | ops.ooboffs = 0; | 73 | ops.ooboffs = 0; |
74 | ops.datbuf = 0; | 74 | ops.datbuf = NULL; |
75 | ops.oobbuf = oobbuf; | 75 | ops.oobbuf = oobbuf; |
76 | ret = mtd->read_oob(mtd, addr, &ops); | 76 | ret = mtd->read_oob(mtd, addr, &ops); |
77 | if (ret || ops.oobretlen != mtd->oobsize) { | 77 | if (ret || ops.oobretlen != mtd->oobsize) { |