Re: [PATCH] Remove needless and non-portable include in mtd

From: Atsushi Nemoto
Date: Mon Oct 20 2003 - 09:42:35 EST


>>>>> On Sun, 19 Oct 2003 21:36:15 -0700 (PDT), "Noah J. Misch" <noah@xxxxxxxxxxx> said:

noah> The #include <asm/setup.h> in drivers/mtd/cmdlinepart.c does not
noah> appear to provide any definition this file uses, and it quickly
noah> breaks builds on architectures that lack such a header,
noah> including ia64 and sparc.

I have posted a patch including this fix to linux-mtd ML two times
(two month ago and a week ago). My patch fixes another problem that
cmdlinepart.c can not handle zero offset value correctly
(ex. "mtdparts=id:2M@2M,2M@0"). Please consider applying this fix
also. Thank you.

--- mtd-20030811/drivers/mtd/cmdlinepart.c Fri May 30 07:00:05 2003
+++ mtd/drivers/mtd/cmdlinepart.c Tue Aug 12 16:35:43 2003
@@ -29,7 +29,6 @@
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
#include <linux/mtd/compatmac.h>
-#include <asm/setup.h>
#include <linux/bootmem.h>

/* error message prefix */
@@ -45,6 +44,7 @@

/* special size referring to all the remaining space in a partition */
#define SIZE_REMAINING 0xffffffff
+#define OFFSET_CONTINUOUS 0xffffffff

struct cmdline_mtd_partition {
struct cmdline_mtd_partition *next;
@@ -77,7 +77,7 @@
{
struct mtd_partition *parts;
unsigned long size;
- unsigned long offset = 0;
+ unsigned long offset = OFFSET_CONTINUOUS;
char *name;
int name_len;
unsigned char *extra_mem;
@@ -312,7 +312,7 @@
{
for(i = 0, offset = 0; i < part->num_parts; i++)
{
- if (!part->parts[i].offset)
+ if (part->parts[i].offset == OFFSET_CONTINUOUS)
part->parts[i].offset = offset;
else
offset = part->parts[i].offset;
---
Atsushi Nemoto
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/