[PATCH] mtd/maps/impa7.c fixes

Andries.Brouwer@cwi.nl
Sat, 21 Jun 2003 01:57:24 +0200 (MEST)


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)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/