Skip to contentSkip to conversation

x86: include: asm: Fix build warning

RFC In review Ksenija Stanojevic 2 participants 3 messages Sep 29, 2015 x86

lore
Share & tools
lore
#0 lore raw

RFC 1/1 x86: include: asm: Fix build warning

Fix build warnings:
error: implicit declaration of function ‘olpc_board_at_least’ [-Werror=implicit-function-declaration]

error: implicit declaration of function ‘olpc_board’
[-Werror=implicit-function-declaration]

in files:
drivers/power/olpc_battery.c
drivers/input/mouse/hgpk.c
drivers/staging/olpc_dcon/olpc_dcon.c
arch/x86/platform/olpc/olpc.c
sound/pci/cs5535audio/cs5535audio_olpc.c
---
Hi,

I know that Greg doesn't accept patches outside staging.
I got some build warnings when working on driver olpc_dcon/olpc_dcon.c and I'm sending this patch here for a review, bc I'm not sure if it's good.

Thanks,
Ksenija

 arch/x86/include/asm/olpc.h | 10 ++++++++++
 1 file changed, 10 insertions(+)
arch/x86/include/asm/olpc.h +10 -0
index 72f9adf6..7245efd 100644
@@ -72,6 +72,11 @@ extern int olpc_ec_sci_query(u16 *sci_value);
 
 #else
 
+static inline uint32_t olpc_board(uint8_t id)
+{
+	return 0;
+}
+
 static inline int machine_is_olpc(void)
 {
 	return 0;
@@ -82,6 +87,11 @@ static inline int olpc_has_dcon(void)
 	return 0;
 }
 
+static inline int olpc_board_at_least(uint32_t rev)
+{
+	return -ENODEV;
+}
+
 static inline void olpc_ec_wakeup_set(u16 value) { }
 static inline void olpc_ec_wakeup_clear(u16 value) { }
 
Signature · 1 line
1.9.1
#1 lore raw
Quoted 7 lines · On Tuesday 29 September 2015 17:30:59 Ksenija Stanojevic wrote:

Fix build warnings:
error: implicit declaration of function ‘olpc_board_at_least’ [-Werror=implicit-function-declaration]

error: implicit declaration of function ‘olpc_board’
[-Werror=implicit-function-declaration]

Quoted 7 lines

in files:
drivers/power/olpc_battery.c
drivers/input/mouse/hgpk.c
drivers/staging/olpc_dcon/olpc_dcon.c
arch/x86/platform/olpc/olpc.c
sound/pci/cs5535audio/cs5535audio_olpc.c

The patch looks good to me in principle, except that it is missing a 'Signed-off-by' line, and a somewhat inaccurate return code:

arch/x86/include/asm/olpc.h static inline int olpc_has_dcon(void) · line 93

Quoted 4 lines
arch/x86/include/asm/olpc.h +4 -0
+static inline int olpc_board_at_least(uint32_t rev)
+{
+       return -ENODEV;
+}

The original function returns either 0 or 1, and so should this version. Returning 0 probably makes more sense here.

With those two things changed, you could send the patch to the x86 architecture maintainers and the people that last touched arch/x86/platform/olpc/olpc.c.

Arnd

#2 lore raw
Quoted 16 lines · Arnd Bergmann
Quoted 7 lines · On Tuesday 29 September 2015 17:30:59 Ksenija Stanojevic wrote:

Fix build warnings:
error: implicit declaration of function ‘olpc_board_at_least’ [-Werror=implicit-function-declaration]

error: implicit declaration of function ‘olpc_board’
[-Werror=implicit-function-declaration]

Quoted 7 lines

in files:
drivers/power/olpc_battery.c
drivers/input/mouse/hgpk.c
drivers/staging/olpc_dcon/olpc_dcon.c
arch/x86/platform/olpc/olpc.c
sound/pci/cs5535audio/cs5535audio_olpc.c

Quoted 2 lines

The patch looks good to me in principle, except that it is missing a 'Signed-off-by' line, and a somewhat inaccurate return code:

Oops, I forgot it.

Quoted 8 lines

arch/x86/include/asm/olpc.h static inline int olpc_has_dcon(void) · line 93

Quoted 4 lines
arch/x86/include/asm/olpc.h +4 -0
+static inline int olpc_board_at_least(uint32_t rev)
+{
+       return -ENODEV;
+}

The original function returns either 0 or 1, and so should this version. Returning 0 probably makes more sense here.

Quoted 4 lines

With those two things changed, you could send the patch to the x86 architecture maintainers and the people that last touched arch/x86/platform/olpc/olpc.c.

Thanks!

Quoted 1 line

Arnd