mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Woodhouse <dwmw2@infradead.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: linux-kernel@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [patch] MTD: fix cfi_interleave() build errors
Date: Mon, 01 Oct 2007 08:21:52 +0100	[thread overview]
Message-ID: <1191223312.9188.3.camel@pmac.infradead.org> (raw)
In-Reply-To: <20071001071437.GA15051@elte.hu>

On Mon, 2007-10-01 at 09:14 +0200, Ingo Molnar wrote:
> MTD is the only code in the tree at the moment that breaks "make 
> randconfig" tests (after ~2000 random rebuilds) - and those tests _are_ 
> immensely useful, they catch a lot of build breakage in the scheduler 
> git tree for example, before i push it out. So if possible it would be 
> nice to have this in .23.

I did send it, a number of weeks ago. Linus didn't take it, so I just
put it in the git tree for 2.6.24. Now I think it's too late, but here
it is again in case Linus has changed his mind...

commit 241651d04d672fb685b2874707016cbbf95931e5
Author: David Woodhouse <dwmw2@infradead.org>
Date:   Thu Sep 6 09:40:21 2007 +0100

[MTD] Fix CFI build error when no map width or interleave supported
    
When building NOR flash support, you have compile-time options for the
bus width and the number of individual chips which are interleaved
together onto that bus. The code to deal with arbitrary geometry is a
bit convoluted, and people want to just configure it for the specific
hardware they have, to avoid the runtime overhead.
    
Selecting _none_ of the available options doesn't make any sense. You
should have at least one. This makes it build though, since people
persist in trying.
    
Signed-off-by: David Woodhouse <dwmw2@infradead.org>

diff --git a/include/linux/mtd/cfi.h b/include/linux/mtd/cfi.h
index 123948b..e17c534 100644
--- a/include/linux/mtd/cfi.h
+++ b/include/linux/mtd/cfi.h
@@ -57,6 +57,15 @@
 #define cfi_interleave_is_8(cfi) (0)
 #endif
 
+#ifndef cfi_interleave
+#warning No CONFIG_MTD_CFI_Ix selected. No NOR chip support can work.
+static inline int cfi_interleave(void *cfi)
+{
+	BUG();
+	return 0;
+}
+#endif
+
 static inline int cfi_interleave_supported(int i)
 {
 	switch (i) {
diff --git a/include/linux/mtd/map.h b/include/linux/mtd/map.h
index 81f3a31..a9fae03 100644
--- a/include/linux/mtd/map.h
+++ b/include/linux/mtd/map.h
@@ -125,7 +125,15 @@
 #endif
 
 #ifndef map_bankwidth
-#error "No bus width supported. What's the point?"
+#warning "No CONFIG_MTD_MAP_BANK_WIDTH_xx selected. No NOR chip support can work"
+static inline int map_bankwidth(void *map)
+{
+	BUG();
+	return 0;
+}
+#define map_bankwidth_is_large(map) (0)
+#define map_words(map) (0)
+#define MAX_MAP_BANKWIDTH 1
 #endif
 
 static inline int map_bankwidth_supported(int w)

-- 
dwmw2


      reply	other threads:[~2007-10-01  7:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-01  4:50 [build bug] MTD build error, v2.6.23-rc8-git4 Ingo Molnar
2007-10-01  5:01 ` [patch] MTD: fix cfi_interleave() build errors Ingo Molnar
2007-10-01  6:54   ` David Woodhouse
2007-10-01  7:14     ` Ingo Molnar
2007-10-01  7:21       ` David Woodhouse [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1191223312.9188.3.camel@pmac.infradead.org \
    --to=dwmw2@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®