Skip to content

Commit 23d4249

Browse files
hanneseder-netJiri Kosina
authored andcommitted
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>
1 parent 9c12bd8 commit 23d4249

2 files changed

Lines changed: 13 additions & 13 deletions

File tree

‎drivers/mtd/tests/mtd_oobtest.c‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ static int write_eraseblock(int ebnum)
136136
ops.ooblen = use_len;
137137
ops.oobretlen = 0;
138138
ops.ooboffs = use_offset;
139-
ops.datbuf = 0;
139+
ops.datbuf = NULL;
140140
ops.oobbuf = writebuf;
141141
err = mtd->write_oob(mtd, addr, &ops);
142142
if (err || ops.oobretlen != use_len) {
@@ -189,7 +189,7 @@ static int verify_eraseblock(int ebnum)
189189
ops.ooblen = use_len;
190190
ops.oobretlen = 0;
191191
ops.ooboffs = use_offset;
192-
ops.datbuf = 0;
192+
ops.datbuf = NULL;
193193
ops.oobbuf = readbuf;
194194
err = mtd->read_oob(mtd, addr, &ops);
195195
if (err || ops.oobretlen != use_len) {
@@ -216,7 +216,7 @@ static int verify_eraseblock(int ebnum)
216216
ops.ooblen = mtd->ecclayout->oobavail;
217217
ops.oobretlen = 0;
218218
ops.ooboffs = 0;
219-
ops.datbuf = 0;
219+
ops.datbuf = NULL;
220220
ops.oobbuf = readbuf;
221221
err = mtd->read_oob(mtd, addr, &ops);
222222
if (err || ops.oobretlen != mtd->ecclayout->oobavail) {
@@ -281,7 +281,7 @@ static int verify_eraseblock_in_one_go(int ebnum)
281281
ops.ooblen = len;
282282
ops.oobretlen = 0;
283283
ops.ooboffs = 0;
284-
ops.datbuf = 0;
284+
ops.datbuf = NULL;
285285
ops.oobbuf = readbuf;
286286
err = mtd->read_oob(mtd, addr, &ops);
287287
if (err || ops.oobretlen != len) {
@@ -522,7 +522,7 @@ static int __init mtd_oobtest_init(void)
522522
ops.ooblen = 1;
523523
ops.oobretlen = 0;
524524
ops.ooboffs = mtd->ecclayout->oobavail;
525-
ops.datbuf = 0;
525+
ops.datbuf = NULL;
526526
ops.oobbuf = writebuf;
527527
printk(PRINT_PREF "attempting to start write past end of OOB\n");
528528
printk(PRINT_PREF "an error is expected...\n");
@@ -542,7 +542,7 @@ static int __init mtd_oobtest_init(void)
542542
ops.ooblen = 1;
543543
ops.oobretlen = 0;
544544
ops.ooboffs = mtd->ecclayout->oobavail;
545-
ops.datbuf = 0;
545+
ops.datbuf = NULL;
546546
ops.oobbuf = readbuf;
547547
printk(PRINT_PREF "attempting to start read past end of OOB\n");
548548
printk(PRINT_PREF "an error is expected...\n");
@@ -566,7 +566,7 @@ static int __init mtd_oobtest_init(void)
566566
ops.ooblen = mtd->ecclayout->oobavail + 1;
567567
ops.oobretlen = 0;
568568
ops.ooboffs = 0;
569-
ops.datbuf = 0;
569+
ops.datbuf = NULL;
570570
ops.oobbuf = writebuf;
571571
printk(PRINT_PREF "attempting to write past end of device\n");
572572
printk(PRINT_PREF "an error is expected...\n");
@@ -586,7 +586,7 @@ static int __init mtd_oobtest_init(void)
586586
ops.ooblen = mtd->ecclayout->oobavail + 1;
587587
ops.oobretlen = 0;
588588
ops.ooboffs = 0;
589-
ops.datbuf = 0;
589+
ops.datbuf = NULL;
590590
ops.oobbuf = readbuf;
591591
printk(PRINT_PREF "attempting to read past end of device\n");
592592
printk(PRINT_PREF "an error is expected...\n");
@@ -610,7 +610,7 @@ static int __init mtd_oobtest_init(void)
610610
ops.ooblen = mtd->ecclayout->oobavail;
611611
ops.oobretlen = 0;
612612
ops.ooboffs = 1;
613-
ops.datbuf = 0;
613+
ops.datbuf = NULL;
614614
ops.oobbuf = writebuf;
615615
printk(PRINT_PREF "attempting to write past end of device\n");
616616
printk(PRINT_PREF "an error is expected...\n");
@@ -630,7 +630,7 @@ static int __init mtd_oobtest_init(void)
630630
ops.ooblen = mtd->ecclayout->oobavail;
631631
ops.oobretlen = 0;
632632
ops.ooboffs = 1;
633-
ops.datbuf = 0;
633+
ops.datbuf = NULL;
634634
ops.oobbuf = readbuf;
635635
printk(PRINT_PREF "attempting to read past end of device\n");
636636
printk(PRINT_PREF "an error is expected...\n");
@@ -670,7 +670,7 @@ static int __init mtd_oobtest_init(void)
670670
ops.ooblen = sz;
671671
ops.oobretlen = 0;
672672
ops.ooboffs = 0;
673-
ops.datbuf = 0;
673+
ops.datbuf = NULL;
674674
ops.oobbuf = writebuf;
675675
err = mtd->write_oob(mtd, addr, &ops);
676676
if (err)
@@ -698,7 +698,7 @@ static int __init mtd_oobtest_init(void)
698698
ops.ooblen = mtd->ecclayout->oobavail * 2;
699699
ops.oobretlen = 0;
700700
ops.ooboffs = 0;
701-
ops.datbuf = 0;
701+
ops.datbuf = NULL;
702702
ops.oobbuf = readbuf;
703703
err = mtd->read_oob(mtd, addr, &ops);
704704
if (err)

‎drivers/mtd/tests/mtd_readtest.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ static int read_eraseblock_by_page(int ebnum)
7171
ops.ooblen = mtd->oobsize;
7272
ops.oobretlen = 0;
7373
ops.ooboffs = 0;
74-
ops.datbuf = 0;
74+
ops.datbuf = NULL;
7575
ops.oobbuf = oobbuf;
7676
ret = mtd->read_oob(mtd, addr, &ops);
7777
if (ret || ops.oobretlen != mtd->oobsize) {

0 commit comments

Comments
 (0)