Skip to contentSkip to conversation

OMAP: fix compilation error

PATCH Superseded Janusz Krzysztofik 3 participants 4 messages May 30, 2011 – May 31, 2011

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

PATCH 1/1 OMAP: fix compilation error

Include <linux/platform_device.h> from arch/arm/plat-omap/include/plat/flash.h, otherwise compilation may break with:

In file included from arch/arm/mach-omap1/flash.c:15:
arch/arm/plat-omap/include/plat/flash.h:14: warning: 'struct platform_device' declared inside parameter list arch/arm/plat-omap/include/plat/flash.h:14: warning: its scope is only this definition or declaration, which is probably not what you want arch/arm/mach-omap1/flash.c:16: warning: 'struct platform_device' declared inside parameter list arch/arm/mach-omap1/flash.c:17: error: conflicting types for 'omap1_set_vpp' arch/arm/plat-omap/include/plat/flash.h:14: error: previous declaration of 'omap1_set_vpp' was here

Detected and corrected while building for Amstrad Delta, confirmed with omap1_defconfig.

---
 arch/arm/plat-omap/include/plat/flash.h |    1 +
 1 file changed, 1 insertion(+)
arch/arm/plat-omap/include/plat/flash.h renamed from arch/arm/plat-omap/include/plat/flash.h.orig +1 -0
@@ -10,6 +10,7 @@
 #define __OMAP_FLASH_H
 
 #include <linux/mtd/map.h>
+#include <linux/platform_device.h>
 
 extern void omap1_set_vpp(struct platform_device *pdev, int enable);
 
#1 lore raw

PATCH 1/1 OMAP: fix compilation error

Quoted 10 lines · Janusz Krzysztofik

Include <linux/platform_device.h> from arch/arm/plat-omap/include/plat/flash.h, otherwise compilation may break with:

In file included from arch/arm/mach-omap1/flash.c:15:
arch/arm/plat-omap/include/plat/flash.h:14: warning: 'struct platform_device' declared inside parameter list arch/arm/plat-omap/include/plat/flash.h:14: warning: its scope is only this definition or declaration, which is probably not what you want arch/arm/mach-omap1/flash.c:16: warning: 'struct platform_device' declared inside parameter list arch/arm/mach-omap1/flash.c:17: error: conflicting types for 'omap1_set_vpp' arch/arm/plat-omap/include/plat/flash.h:14: error: previous declaration of 'omap1_set_vpp' was here

Just forward-declare the struct by adding:

struct platform_device;

in this header; there's no need to add to the complexities of header file inclusion...

#2 lore raw

PATCH v2 1/1 OMAP: fix compilation error

Forward-declare platform_device structure in arch/arm/plat-omap/include/plat/flash.h, otherwise compilation may break with:

In file included from arch/arm/mach-omap1/flash.c:15:
arch/arm/plat-omap/include/plat/flash.h:14: warning: 'struct platform_device' declared inside parameter list arch/arm/plat-omap/include/plat/flash.h:14: warning: its scope is only this definition or declaration, which is probably not what you want arch/arm/mach-omap1/flash.c:16: warning: 'struct platform_device' declared inside parameter list arch/arm/mach-omap1/flash.c:17: error: conflicting types for 'omap1_set_vpp' arch/arm/plat-omap/include/plat/flash.h:14: error: previous declaration of 'omap1_set_vpp' was here

Detected and corrected while building for Amstrad Delta, confirmed with omap1_defconfig.

---
v1 -> v2 change requested by Russell King (thanks!):
- no need to add to the complexities of header file inclusion

 arch/arm/plat-omap/include/plat/flash.h |    1 +
 1 file changed, 1 insertion(+)
arch/arm/plat-omap/include/plat/flash.h renamed from arch/arm/plat-omap/include/plat/flash.h.orig +1 -0
@@ -11,6 +11,7 @@
 
 #include <linux/mtd/map.h>
 
+struct platform_device;
 extern void omap1_set_vpp(struct platform_device *pdev, int enable);
 
 #endif
#3 lore raw

PATCH v2 1/1 OMAP: fix compilation error

Quoted 3 lines · Janusz Krzysztofik

Detected and corrected while building for Amstrad Delta, confirmed with omap1_defconfig.

Thanks, will queue this fix.

Tony