mtd/drivers/mtd/devices lart.c,1.9,1.10 ms02-nv.c,1.11,1.12
David Woodhouse
dwmw2 at infradead.org
Wed Mar 29 03:31:13 EST 2006
- Previous message: mtd/drivers/mtd/nand Kconfig,1.37,1.38
- Next message: mtd/drivers/mtd/maps alchemy-flash.c, 1.2, 1.3 cfi_flagadm.c, 1.15,
1.16 dbox2-flash.c, 1.14, 1.15 dilnetpc.c, 1.20, 1.21 dmv182.c,
1.6, 1.7 h720x-flash.c, 1.12, 1.13 netsc520.c, 1.14,
1.15 nettel.c, 1.12, 1.13 ocotea.c, 1.4, 1.5 pcmciamtd.c, 1.58,
1.59 redwood.c, 1.11, 1.12 sbc8240.c, 1.5, 1.6 sc520cdp.c,
1.23, 1.24 scx200_docflash.c, 1.12, 1.13 sharpsl-flash.c, 1.7,
1.8 ts5500_flash.c, 1.6, 1.7 uclinux.c, 1.12, 1.13
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /home/cvs/mtd/drivers/mtd/devices
In directory phoenix.infradead.org:/tmp/cvs-serv3863/drivers/mtd/devices
Modified Files:
lart.c ms02-nv.c
Log Message:
From: Tobias Klauser <tklauser at nuerscht.ch>
Use ARRAY_SIZE macro instead of sizeof(x)/sizeof(x[0]) and remove
duplicates of the macro.
Signed-off-by: Tobias Klauser <tklauser at nuerscht.ch>
Cc: Thomas Gleixner <tglx at linutronix.de>
Signed-off-by: David Woodhouse <dwmw2 at infradead.org>
Signed-off-by: Andrew Morton <akpm at osdl.org>
Index: lart.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/devices/lart.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- lart.c 7 Nov 2005 11:14:25 -0000 1.9
+++ lart.c 29 Mar 2006 08:31:11 -0000 1.10
@@ -581,8 +581,6 @@
/***************************************************************************************************/
-#define NB_OF(x) (sizeof (x) / sizeof (x[0]))
-
static struct mtd_info mtd;
static struct mtd_erase_region_info erase_regions[] = {
@@ -640,7 +638,7 @@
mtd.flags = MTD_CAP_NORFLASH;
mtd.size = FLASH_BLOCKSIZE_PARAM * FLASH_NUMBLOCKS_16m_PARAM + FLASH_BLOCKSIZE_MAIN * FLASH_NUMBLOCKS_16m_MAIN;
mtd.erasesize = FLASH_BLOCKSIZE_MAIN;
- mtd.numeraseregions = NB_OF (erase_regions);
+ mtd.numeraseregions = ARRAY_SIZE(erase_regions);
mtd.eraseregions = erase_regions;
mtd.erase = flash_erase;
mtd.read = flash_read;
@@ -670,9 +668,9 @@
result,mtd.eraseregions[result].numblocks);
#ifdef HAVE_PARTITIONS
- printk ("\npartitions = %d\n",NB_OF (lart_partitions));
+ printk ("\npartitions = %d\n", ARRAY_SIZE(lart_partitions));
- for (result = 0; result < NB_OF (lart_partitions); result++)
+ for (result = 0; result < ARRAY_SIZE(lart_partitions); result++)
printk (KERN_DEBUG
"\n\n"
"lart_partitions[%d].name = %s\n"
@@ -687,7 +685,7 @@
#ifndef HAVE_PARTITIONS
result = add_mtd_device (&mtd);
#else
- result = add_mtd_partitions (&mtd,lart_partitions,NB_OF (lart_partitions));
+ result = add_mtd_partitions (&mtd,lart_partitions, ARRAY_SIZE(lart_partitions));
#endif
return (result);
Index: ms02-nv.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/devices/ms02-nv.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- ms02-nv.c 14 Nov 2005 13:41:47 -0000 1.11
+++ ms02-nv.c 29 Mar 2006 08:31:11 -0000 1.12
@@ -308,7 +308,7 @@
break;
}
- for (i = 0; i < (sizeof(ms02nv_addrs) / sizeof(*ms02nv_addrs)); i++)
+ for (i = 0; i < ARRAY_SIZE(ms02nv_addrs); i++)
if (!ms02nv_init_one(ms02nv_addrs[i] << stride))
count++;
- Previous message: mtd/drivers/mtd/nand Kconfig,1.37,1.38
- Next message: mtd/drivers/mtd/maps alchemy-flash.c, 1.2, 1.3 cfi_flagadm.c, 1.15,
1.16 dbox2-flash.c, 1.14, 1.15 dilnetpc.c, 1.20, 1.21 dmv182.c,
1.6, 1.7 h720x-flash.c, 1.12, 1.13 netsc520.c, 1.14,
1.15 nettel.c, 1.12, 1.13 ocotea.c, 1.4, 1.5 pcmciamtd.c, 1.58,
1.59 redwood.c, 1.11, 1.12 sbc8240.c, 1.5, 1.6 sc520cdp.c,
1.23, 1.24 scx200_docflash.c, 1.12, 1.13 sharpsl-flash.c, 1.7,
1.8 ts5500_flash.c, 1.6, 1.7 uclinux.c, 1.12, 1.13
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the linux-mtd-cvs
mailing list