* [PATCH] mtd/maps/impa7.c fixes
@ 2003-06-20 23:57 Andries.Brouwer
2003-06-23 11:49 ` David Woodhouse
0 siblings, 1 reply; 2+ messages in thread
From: Andries.Brouwer @ 2003-06-20 23:57 UTC (permalink / raw)
To: dwmw2, linux-kernel, torvalds
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)
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] mtd/maps/impa7.c fixes
2003-06-20 23:57 [PATCH] mtd/maps/impa7.c fixes Andries.Brouwer
@ 2003-06-23 11:49 ` David Woodhouse
0 siblings, 0 replies; 2+ messages in thread
From: David Woodhouse @ 2003-06-23 11:49 UTC (permalink / raw)
To: Andries.Brouwer; +Cc: linux-kernel, Pavel Bartusek, mag
On Sat, 2003-06-21 at 00:57, Andries.Brouwer@cwi.nl 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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-06-23 11:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-20 23:57 [PATCH] mtd/maps/impa7.c fixes Andries.Brouwer
2003-06-23 11:49 ` David Woodhouse
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).