I happened to come across mtd/maps/impa7.c.
It looks like some stuff that needs <linux/mtd/partitions.h>
occurs outside #ifdef CONFIG_MTD_PARTITIONS.
Also, there is a spurious #endif.
Also, there is one of the many redefinitions for ARRAY_SIZE.
Below a patch.
Not compiled. Not tested.
Andries
diff -u --recursive --new-file -X /linux/dontdiff a/drivers/mtd/maps/impa7.c b/drivers/mtd/maps/impa7.c
--- a/drivers/mtd/maps/impa7.c Sun Jun 15 01:40:57 2003
+++ b/drivers/mtd/maps/impa7.c Sat Jun 21 02:25:34 2003
@@ -66,12 +66,11 @@
},
};
-#define NB_OF(x) (sizeof (x) / sizeof (x[0]))
+static int mtd_parts_nb = 0;
+static struct mtd_partition *mtd_parts = 0;
#endif
-static int mtd_parts_nb = 0;
-static struct mtd_partition *mtd_parts = 0;
static const char *probes[] = { "cmdlinepart", NULL };
int __init init_impa7(void)
@@ -119,11 +118,11 @@
0);
if (mtd_parts_nb > 0)
part_type = "command line";
-#endif
+
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";
}
if (mtd_parts_nb <= 0)
On Sat, 2003-06-21 at 00:57, [email protected] wrote:
> I happened to come across mtd/maps/impa7.c.
> It looks like some stuff that needs <linux/mtd/partitions.h>
> occurs outside #ifdef CONFIG_MTD_PARTITIONS.
> Also, there is a spurious #endif.
> Also, there is one of the many redefinitions for ARRAY_SIZE.
> Below a patch.
Thank you. I've applied this and some additional cleanups too -- and
also removed the redefinition of ARRAY_SIZE from other map drivers which
had it.
Compiled but still not tested as I don't have this hardware -- driver
owner Cc'd.
--
dwmw2