Skip to contentSkip to conversation

ARM: OMAP: fix build, sparse problems in cleanup-headers

PATCH New Paul Walmsley 1 participant 4 messages Oct 26, 2012

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

cover ARM: OMAP: fix build, sparse problems in cleanup-headers

Fix several build failures and a sparse warning in the linux-omap omap-for-v3.8/cleanup-headers branch.

Basic test logs are here:

http://www.pwsan.com/omap/testlogs/cleanup-headers-compile-fixes-3.8/20121026132711/

Due to underlying problems in v3.7-rc2, several tests fail. The failures are unrelated to these patches.

Intended for 3.8 cleanup.

- Paul

---

cleanup-headers-compile-fixes-3.8
text data bss dec hex filename
5452826 352260 121588 5926674 5a6f12 vmlinux.omap1_defconfig.orig
5452826 352260 121588 5926674 5a6f12 vmlinux.omap1_defconfig

Paul Walmsley (3):

      ARM: OMAP2+: fix build breakage introduced by commit b7754452b3e27716347a528b47b0a1083af32520
      ARM: OMAP1: fix build breakage introduced by commit 25c7d49ed48b4843da7dea56a81ae7f620211ee0
      ARM: OMAP1: fix sparse warning added by commit 4c98dc6b8ef2f73bdbfa78186db9a76507ba9ea3
 arch/arm/mach-omap1/fpga.c   |    1 +
 arch/arm/mach-omap1/pm_bus.c |    2 ++
 drivers/mtd/onenand/omap2.c  |   36 ++++++++++++++++++++++++------------
 3 files changed, 27 insertions(+), 12 deletions(-)
#1 lore raw

PATCH 1/3 ARM: OMAP2+: fix build breakage introduced by commit b7754452b3e27716347a528b47b0a1083af32520

Commit b7754452b3e27716347a528b47b0a1083af32520 ("mtd: onenand: omap:
use pdata info instead of cpu_is") broke an OMAP3+4 build and an N800 multi-OMAP2xxx build here:

drivers/built-in.o: In function `omap2_onenand_probe':
drivers/mtd/onenand/omap2.c:742: undefined reference to omap2_onenand_read_bufferram' drivers/mtd/onenand/omap2.c:743: undefined reference to omap2_onenand_write_bufferram' drivers/mtd/onenand/omap2.c:742: undefined reference to omap2_onenand_read_bufferram' drivers/mtd/onenand/omap2.c:743: undefined reference to omap2_onenand_write_bufferram'

...

drivers/built-in.o: In function `omap2_onenand_probe':
drivers/mtd/onenand/omap2.c:788: undefined reference to omap3_onenand_read_bufferram' drivers/mtd/onenand/omap2.c:788: undefined reference to omap3_onenand_write_bufferram'

Fix by declaring static functions for the missing symbols, rather than just prototypes.

Cc Afzal Mohammed <[email protected]>
Cc Tony Lindgren <[email protected]>
---
 drivers/mtd/onenand/omap2.c |   36 ++++++++++++++++++++++++------------
 1 file changed, 24 insertions(+), 12 deletions(-)
drivers/mtd/onenand/omap2.c +24 -12
index 53069ae..99f96e1 100644
@@ -445,13 +445,19 @@ out_copy:
 
 #else
 
-int omap3_onenand_read_bufferram(struct mtd_info *mtd, int area,
-				 unsigned char *buffer, int offset,
-				 size_t count);
+static int omap3_onenand_read_bufferram(struct mtd_info *mtd, int area,
+					unsigned char *buffer, int offset,
+					size_t count)
+{
+	return -ENOSYS;
+}
 
-int omap3_onenand_write_bufferram(struct mtd_info *mtd, int area,
-				  const unsigned char *buffer,
-				  int offset, size_t count);
+static int omap3_onenand_write_bufferram(struct mtd_info *mtd, int area,
+					 const unsigned char *buffer,
+					 int offset, size_t count)
+{
+	return -ENOSYS;
+}
 
 #endif
 
@@ -549,13 +555,19 @@ static int omap2_onenand_write_bufferram(struct mtd_info *mtd, int area,
 
 #else
 
-int omap2_onenand_read_bufferram(struct mtd_info *mtd, int area,
-				 unsigned char *buffer, int offset,
-				 size_t count);
+static int omap2_onenand_read_bufferram(struct mtd_info *mtd, int area,
+					unsigned char *buffer, int offset,
+					size_t count)
+{
+	return -ENOSYS;
+}
 
-int omap2_onenand_write_bufferram(struct mtd_info *mtd, int area,
-				  const unsigned char *buffer,
-				  int offset, size_t count);
+static int omap2_onenand_write_bufferram(struct mtd_info *mtd, int area,
+					 const unsigned char *buffer,
+					 int offset, size_t count)
+{
+	return -ENOSYS;
+}
 
 #endif
 
#2 lore raw

PATCH 2/3 ARM: OMAP1: fix build breakage introduced by commit 25c7d49ed48b4843da7dea56a81ae7f620211ee0

In reply to Paul Walmsley

Commit 25c7d49ed48b4843da7dea56a81ae7f620211ee0 ("ARM: OMAP: Make omap_device local to mach-omap2") broke an OMAP5912-only build here:

arch/arm/mach-omap1/pm_bus.c: In function 'omap1_pm_runtime_init':
arch/arm/mach-omap1/pm_bus.c:69:2: error: implicit declaration of function 'cpu_class_is_omap1'
make[1]: *** [arch/arm/mach-omap1/pm_bus.o] Error 1

Fix by adding a missing include.

---
 arch/arm/mach-omap1/pm_bus.c |    2 ++
 1 file changed, 2 insertions(+)
arch/arm/mach-omap1/pm_bus.c +2 -0
index 16bf2f9..3f2d396 100644
@@ -19,6 +19,8 @@
 #include <linux/clk.h>
 #include <linux/err.h>
 
+#include "soc.h"
+
 #ifdef CONFIG_PM_RUNTIME
 static int omap1_pm_runtime_suspend(struct device *dev)
 {
#3 lore raw

PATCH 3/3 ARM: OMAP1: fix sparse warning added by commit 4c98dc6b8ef2f73bdbfa78186db9a76507ba9ea3

In reply to Paul Walmsley

Commit 4c98dc6b8ef2f73bdbfa78186db9a76507ba9ea3 ("ARM: OMAP: Make plat/fpga.h local to arch/arm/plat-omap") results in a new warning from sparse:

arch/arm/mach-omap1/fpga.c:147:6: warning: symbol 'omap1510_fpga_init_irq' was not declared. Should it be static?

Fix by adding a missing include.

---
 arch/arm/mach-omap1/fpga.c |    1 +
 1 file changed, 1 insertion(+)
arch/arm/mach-omap1/fpga.c +1 -0
index 4ec220d..d940fac 100644
@@ -32,6 +32,7 @@
 #include <mach/hardware.h>
 
 #include "iomap.h"
+#include "common.h"
 
 static void fpga_mask_irq(struct irq_data *d)
 {