mtd/drivers/mtd/maps ebony.c,1.7,1.8 edb7312.c,1.8,1.9 iq80310.c,1.16,1.17 lubbock-flash.c,1.8,1.9 pb1xxx-flash.c,1.8,1.9 tqm8xxl.c,1.8,1.9

David Woodhouse dwmw2 at infradead.org
Mon Jun 23 07:48:22 EDT 2003


Update of /home/cvs/mtd/drivers/mtd/maps
In directory phoenix.infradead.org:/tmp/cvs-serv15982

Modified Files:
	ebony.c edb7312.c iq80310.c lubbock-flash.c pb1xxx-flash.c 
	tqm8xxl.c 
Log Message:
Remove NB_OF reimplementation of ARRAY_SIZE

Index: ebony.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/maps/ebony.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- ebony.c	21 May 2003 12:45:18 -0000	1.7
+++ ebony.c	23 Jun 2003 11:48:18 -0000	1.8
@@ -60,8 +60,6 @@
 	}
 };
 
-#define NB_OF(x)  (sizeof(x)/sizeof(x[0]))
-
 int __init init_ebony(void)
 {
 	u8 fpga0_reg;
@@ -109,7 +107,7 @@
 	if (flash) {
 		flash->owner = THIS_MODULE;
 		add_mtd_partitions(flash, ebony_small_partitions,
-					NB_OF(ebony_small_partitions));
+					ARRAY_SIZE(ebony_small_partitions));
 	} else {
 		printk("map probe failed for flash\n");
 		return -ENXIO;
@@ -131,7 +129,7 @@
 	if (flash) {
 		flash->owner = THIS_MODULE;
 		add_mtd_partitions(flash, ebony_large_partitions,
-					NB_OF(ebony_large_partitions));
+					ARRAY_SIZE(ebony_large_partitions));
 	} else {
 		printk("map probe failed for flash\n");
 		return -ENXIO;

Index: edb7312.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/maps/edb7312.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- edb7312.c	21 May 2003 12:45:18 -0000	1.8
+++ edb7312.c	23 Jun 2003 11:48:18 -0000	1.9
@@ -67,7 +67,6 @@
 	},
 };
 
-#define NB_OF(x) (sizeof (x) / sizeof (x[0]))
 static const char *probes[] = { "RedBoot", "cmdlinepart", NULL };
 
 #endif
@@ -109,7 +108,7 @@
 		if (mtd_parts_nb == 0)
 		{
 			mtd_parts = static_partitions;
-			mtd_parts_nb = NB_OF(static_partitions);
+			mtd_parts_nb = ARRAY_SIZE(static_partitions);
 			part_type = "static";
 		}
 #endif

Index: iq80310.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/maps/iq80310.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- iq80310.c	21 May 2003 15:15:07 -0000	1.16
+++ iq80310.c	23 Jun 2003 11:48:18 -0000	1.17
@@ -57,8 +57,6 @@
 	}
 };
 
-#define NB_OF(x)  (sizeof(x)/sizeof(x[0]))
-
 static struct mtd_info *mymtd;
 static struct mtd_partition *parsed_parts;
 static const char *probes[] = { "RedBoot", "cmdlinepart", NULL };
@@ -94,7 +92,7 @@
 		nb_parts = parsed_nr_parts;
 	} else {
 		parts = iq80310_partitions;
-		nb_parts = NB_OF(iq80310_partitions);
+		nb_parts = ARRAY_SIZE(iq80310_partitions);
 	}
 	add_mtd_partitions(mymtd, parts, nb_parts);
 	return 0;

Index: lubbock-flash.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/maps/lubbock-flash.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- lubbock-flash.c	21 May 2003 12:45:19 -0000	1.8
+++ lubbock-flash.c	23 Jun 2003 11:48:18 -0000	1.9
@@ -52,8 +52,6 @@
 	}
 };
 
-#define NB_OF(x)  (sizeof(x)/sizeof(x[0]))
-
 static struct mtd_info *mymtds[2];
 static struct mtd_partition *parsed_parts[2];
 static int nr_parsed_parts[2];
@@ -116,7 +114,7 @@
 			add_mtd_partitions(mymtds[i], parsed_parts[i], nr_parsed_parts[i]);
 		} else if (!i) {
 			printk("Using static partitions on %s\n", lubbock_maps[i].name);
-			add_mtd_partitions(mymtds[i], lubbock_partitions, NB_OF(lubbock_partitions));
+			add_mtd_partitions(mymtds[i], lubbock_partitions, ARRAY_SIZE(lubbock_partitions));
 		} else {
 			printk("Registering %s as whole device\n", lubbock_maps[i].name);
 			add_mtd_device(mymtds[i]);

Index: pb1xxx-flash.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/maps/pb1xxx-flash.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- pb1xxx-flash.c	21 May 2003 12:45:19 -0000	1.8
+++ pb1xxx-flash.c	23 Jun 2003 11:48:18 -0000	1.9
@@ -131,9 +131,6 @@
 #error Unsupported board
 #endif
 
-
-#define NB_OF(x)  (sizeof(x)/sizeof(x[0]))
-
 static struct mtd_partition *parsed_parts;
 static struct mtd_info *mymtd;
 
@@ -151,7 +148,7 @@
 	 */
 	part_type = "static";
 	parts = pb1xxx_partitions;
-	nb_parts = NB_OF(pb1xxx_partitions);
+	nb_parts = ARRAY_SIZE(pb1xxx_partitions);
 	pb1xxx_map.size = flash_size;
 
 	/*

Index: tqm8xxl.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/maps/tqm8xxl.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- tqm8xxl.c	21 May 2003 12:45:20 -0000	1.8
+++ tqm8xxl.c	23 Jun 2003 11:48:18 -0000	1.9
@@ -110,8 +110,6 @@
 };
 #endif
 
-#define NB_OF(x)  (sizeof(x)/sizeof(x[0]))
-
 int __init init_tqm_mtd(void)
 {
 	int idx = 0, ret = 0;
@@ -198,11 +196,11 @@
 	 */
 	part_banks[0].mtd_part = tqm8xxl_partitions;
 	part_banks[0].type = "Static image";
-	part_banks[0].nums = NB_OF(tqm8xxl_partitions);
+	part_banks[0].nums = ARRAY_SIZE(tqm8xxl_partitions);
 
 	part_banks[1].mtd_part = tqm8xxl_fs_partitions;
 	part_banks[1].type = "Static file system";
-	part_banks[1].nums = NB_OF(tqm8xxl_fs_partitions);
+	part_banks[1].nums = ARRAY_SIZE(tqm8xxl_fs_partitions);
 
 	for(idx = 0; idx < num_banks ; idx++) {
 		if (part_banks[idx].nums == 0) {




More information about the linux-mtd-cvs mailing list