mtd: tests: consolidate kmalloc/memset 0 call to kzalloc
authorNicholas Mc Guire <hofrat@osadl.org>
Thu, 31 Dec 2015 15:21:22 +0000 (16:21 +0100)
committerBrian Norris <computersforpeace@gmail.com>
Wed, 6 Jan 2016 23:17:42 +0000 (15:17 -0800)
This is an API consolidation only. The use of kmalloc + memset to 0
is equivalent to kzalloc.

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
drivers/mtd/tests/pagetest.c

index ba1890d5632ce1607d5ce8371c3ff962f8b8cc41..ff1e0565b0204864f2f5487be0001696e2b2fca1 100644 (file)
@@ -127,13 +127,12 @@ static int crosstest(void)
        unsigned char *pp1, *pp2, *pp3, *pp4;
 
        pr_info("crosstest\n");
-       pp1 = kmalloc(pgsize * 4, GFP_KERNEL);
+       pp1 = kzalloc(pgsize * 4, GFP_KERNEL);
        if (!pp1)
                return -ENOMEM;
        pp2 = pp1 + pgsize;
        pp3 = pp2 + pgsize;
        pp4 = pp3 + pgsize;
-       memset(pp1, 0, pgsize * 4);
 
        addr0 = 0;
        for (i = 0; i < ebcnt && bbt[i]; ++i)