diff options
Diffstat (limited to 'drivers/mtd/maps/sbc8240.c')
-rw-r--r-- | drivers/mtd/maps/sbc8240.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/mtd/maps/sbc8240.c b/drivers/mtd/maps/sbc8240.c index 225cdd9ba5b2..350286dc1d2e 100644 --- a/drivers/mtd/maps/sbc8240.c +++ b/drivers/mtd/maps/sbc8240.c | |||
@@ -66,7 +66,7 @@ static struct map_info sbc8240_map[2] = { | |||
66 | } | 66 | } |
67 | }; | 67 | }; |
68 | 68 | ||
69 | #define NUM_FLASH_BANKS (sizeof(sbc8240_map) / sizeof(struct map_info)) | 69 | #define NUM_FLASH_BANKS ARRAY_SIZE(sbc8240_map) |
70 | 70 | ||
71 | /* | 71 | /* |
72 | * The following defines the partition layout of SBC8240 boards. | 72 | * The following defines the partition layout of SBC8240 boards. |
@@ -125,8 +125,6 @@ static struct mtd_partition sbc8240_fs_partitions [] = { | |||
125 | } | 125 | } |
126 | }; | 126 | }; |
127 | 127 | ||
128 | #define NB_OF(x) (sizeof (x) / sizeof (x[0])) | ||
129 | |||
130 | /* trivial struct to describe partition information */ | 128 | /* trivial struct to describe partition information */ |
131 | struct mtd_part_def | 129 | struct mtd_part_def |
132 | { | 130 | { |
@@ -190,10 +188,10 @@ int __init init_sbc8240_mtd (void) | |||
190 | #ifdef CONFIG_MTD_PARTITIONS | 188 | #ifdef CONFIG_MTD_PARTITIONS |
191 | sbc8240_part_banks[0].mtd_part = sbc8240_uboot_partitions; | 189 | sbc8240_part_banks[0].mtd_part = sbc8240_uboot_partitions; |
192 | sbc8240_part_banks[0].type = "static image"; | 190 | sbc8240_part_banks[0].type = "static image"; |
193 | sbc8240_part_banks[0].nums = NB_OF(sbc8240_uboot_partitions); | 191 | sbc8240_part_banks[0].nums = ARRAY_SIZE(sbc8240_uboot_partitions); |
194 | sbc8240_part_banks[1].mtd_part = sbc8240_fs_partitions; | 192 | sbc8240_part_banks[1].mtd_part = sbc8240_fs_partitions; |
195 | sbc8240_part_banks[1].type = "static file system"; | 193 | sbc8240_part_banks[1].type = "static file system"; |
196 | sbc8240_part_banks[1].nums = NB_OF(sbc8240_fs_partitions); | 194 | sbc8240_part_banks[1].nums = ARRAY_SIZE(sbc8240_fs_partitions); |
197 | 195 | ||
198 | for (i = 0; i < NUM_FLASH_BANKS; i++) { | 196 | for (i = 0; i < NUM_FLASH_BANKS; i++) { |
199 | 197 | ||