]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
[PATCH] CRIS: user ARRAY_SIZE macro when appropriate
authorAhmed S. Darwish <darwish.07@gmail.com>
Sat, 10 Feb 2007 09:43:51 +0000 (01:43 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Sun, 11 Feb 2007 18:51:20 +0000 (10:51 -0800)
Use ARRAY_SIZE macro already defined in linux/kernel.h

Signed-off-by: Ahmed S. Darwish <darwish.07@gmail.com>
Cc: Mikael Starvik <starvik@axis.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/cris/arch-v10/drivers/axisflashmap.c
arch/cris/mm/tlb.c

index ffade19a14e6f0b974dbea77034bacc329ebd795..efd7b0f3a91042aa85455309594979ec6de44a3a 100644 (file)
@@ -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 "
index 0df390a656cdf9f1edfc94c25b5bf6cbc7a33497..c4a98e2e529e04dd46b85ff768bdabad3df8d1a4 100644 (file)
@@ -8,6 +8,7 @@
  */
 
 #include <linux/init.h>
+#include <linux/kernel.h>
 #include <asm/tlb.h>
 
 #define D(x)
@@ -100,7 +101,7 @@ tlb_init(void)
 
        /* clear the page_id map */
 
-       for (i = 1; i < sizeof (page_id_map) / sizeof (page_id_map[0]); i++)
+       for (i = 1; i < ARRAY_SIZE(page_id_map); i++)
                page_id_map[i] = NULL;
        
        /* invalidate the entire TLB */