[PATCH] CRIS: user ARRAY_SIZE macro when appropriate
[sfrench/cifs-2.6.git] / arch / cris / arch-v10 / drivers / axisflashmap.c
index 11ab3836aac65102d87b97429bdceb25e14e0218..efd7b0f3a91042aa85455309594979ec6de44a3a 100644 (file)
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
-#include <linux/config.h>
 #include <linux/init.h>
+#include <linux/slab.h>
 
 #include <linux/mtd/concat.h>
 #include <linux/mtd/map.h>
@@ -359,8 +359,7 @@ static struct mtd_info *flash_probe(void)
                 * So we use the MTD concatenation layer instead of further
                 * complicating the probing procedure.
                 */
-               mtd_cse = mtd_concat_create(mtds,
-                                           sizeof(mtds) / sizeof(mtds[0]),
+               mtd_cse = mtd_concat_create(mtds, ARRAY_SIZE(mtds),
                                            "cse0+cse1");
 #else
                printk(KERN_ERR "%s and %s: Cannot concatenate due to kernel "
@@ -516,7 +515,7 @@ static int __init init_axis_flash(void)
 #else
                struct mtd_info *mtd_ram;
 
-               mtd_ram = (struct mtd_info *)kmalloc(sizeof(struct mtd_info),
+               mtd_ram = kmalloc(sizeof(struct mtd_info),
                                                     GFP_KERNEL);
                if (!mtd_ram) {
                        panic("axisflashmap couldn't allocate memory for "