[PATCH 2.6.20] arch CRIS: user ARRAY_SIZE macro when appropriate

From: Ahmed S. Darwish
Date: Sun Feb 04 2007 - 21:41:28 EST


Hi all,

A patch to use ARRAY_SIZE macro already defined in linux/kernel.h

Signed-off-by: Ahmed S. Darwish <darwish.07@xxxxxxxxx>
---
Patch isn't compile checked since I have no CRIS machine at hand.

diff --git a/arch/cris/arch-v10/drivers/axisflashmap.c b/arch/cris/arch-v10/drivers/axisflashmap.c
index ffade19..c5d90fc 100644
--- a/arch/cris/arch-v10/drivers/axisflashmap.c
+++ b/arch/cris/arch-v10/drivers/axisflashmap.c
@@ -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 "
diff --git a/arch/cris/mm/tlb.c b/arch/cris/mm/tlb.c
index 0df390a..c4a98e2 100644
--- a/arch/cris/mm/tlb.c
+++ b/arch/cris/mm/tlb.c
@@ -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 */

--
Ahmed S. Darwish
http://darwish-07.blogspot.com
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/