Skip to contentSkip to conversation

firmware: fix build errors in paged buffer handling code

PATCH Superseded Takashi Iwai 2 participants 4 messages Jul 22, 2019

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 firmware: fix build errors in paged buffer handling code

From: Mauro Rossi <[email protected]>

fw_{grow,map}_paged_buf() need to be defined as static inline when CONFIG_FW_LOADER_PAGED_BUF is not enabled, infact fw_free_paged_buf() is also defined as static inline when CONFIG_FW_LOADER_PAGED_BUF is not enabled.

Fixes the following mutiple definition building errors for Android kernel:

drivers/base/firmware_loader/fallback_efi.o: In function `fw_grow_paged_buf':
fallback_efi.c:(.text+0x0): multiple definition of fw_grow_paged_buf' drivers/base/firmware_loader/main.o:(.text+0x73b): first defined here drivers/base/firmware_loader/fallback_efi.o: In function fw_map_paged_buf':
fallback_efi.c:(.text+0xf): multiple definition of `fw_map_paged_buf' drivers/base/firmware_loader/main.o:(.text+0x74a): first defined here

[ slightly corrected the patch description -- tiwai ]

Fixes 5342e7093ff2 ("firmware: Factor out the paged buffer handling code")
Fixes 82fd7a8142a1 ("firmware: Add support for loading compressed files")
---
 drivers/base/firmware_loader/firmware.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/base/firmware_loader/firmware.h +2 -2
index 7048a41973ed..842e63f19f22 100644
@@ -141,8 +141,8 @@ int fw_grow_paged_buf(struct fw_priv *fw_priv, int pages_needed);
 int fw_map_paged_buf(struct fw_priv *fw_priv);
 #else
 static inline void fw_free_paged_buf(struct fw_priv *fw_priv) {}
-int fw_grow_paged_buf(struct fw_priv *fw_priv, int pages_needed) { return -ENXIO; }
-int fw_map_paged_buf(struct fw_priv *fw_priv) { return -ENXIO; }
+static int fw_grow_paged_buf(struct fw_priv *fw_priv, int pages_needed) { return -ENXIO; }
+static int fw_map_paged_buf(struct fw_priv *fw_priv) { return -ENXIO; }
 #endif
 
 #endif /* __FIRMWARE_LOADER_H */
Signature · 1 line
2.16.4
#1 lore raw
Quoted 17 lines · Takashi Iwai

From: Mauro Rossi <[email protected]>

fw_{grow,map}_paged_buf() need to be defined as static inline when CONFIG_FW_LOADER_PAGED_BUF is not enabled, infact fw_free_paged_buf() is also defined as static inline when CONFIG_FW_LOADER_PAGED_BUF is not enabled.

Fixes the following mutiple definition building errors for Android kernel:

drivers/base/firmware_loader/fallback_efi.o: In function `fw_grow_paged_buf':
fallback_efi.c:(.text+0x0): multiple definition of fw_grow_paged_buf' drivers/base/firmware_loader/main.o:(.text+0x73b): first defined here drivers/base/firmware_loader/fallback_efi.o: In function fw_map_paged_buf':
fallback_efi.c:(.text+0xf): multiple definition of `fw_map_paged_buf' drivers/base/firmware_loader/main.o:(.text+0x74a): first defined here

Quoted 6 lines

[ slightly corrected the patch description -- tiwai ]

Fixes 5342e7093ff2 ("firmware: Factor out the paged buffer handling code")
Fixes 82fd7a8142a1 ("firmware: Add support for loading compressed files")

Please discard this one. It's missing the inline, as Mauro already suggested in another mail.

Will resubmit the revised one. Sorry for inconvenience.

Takashi

#2 lore raw
Quoted 26 lines · Takashi Iwai
Quoted 17 lines · Takashi Iwai

From: Mauro Rossi <[email protected]>

fw_{grow,map}_paged_buf() need to be defined as static inline when CONFIG_FW_LOADER_PAGED_BUF is not enabled, infact fw_free_paged_buf() is also defined as static inline when CONFIG_FW_LOADER_PAGED_BUF is not enabled.

Fixes the following mutiple definition building errors for Android kernel:

drivers/base/firmware_loader/fallback_efi.o: In function `fw_grow_paged_buf':
fallback_efi.c:(.text+0x0): multiple definition of fw_grow_paged_buf' drivers/base/firmware_loader/main.o:(.text+0x73b): first defined here drivers/base/firmware_loader/fallback_efi.o: In function fw_map_paged_buf':
fallback_efi.c:(.text+0xf): multiple definition of `fw_map_paged_buf' drivers/base/firmware_loader/main.o:(.text+0x74a): first defined here

Quoted 6 lines

[ slightly corrected the patch description -- tiwai ]

Fixes 5342e7093ff2 ("firmware: Factor out the paged buffer handling code")
Fixes 82fd7a8142a1 ("firmware: Add support for loading compressed files")
Quoted 4 lines

Please discard this one. It's missing the inline, as Mauro already suggested in another mail.

Will resubmit the revised one. Sorry for inconvenience.

Ugh, I already applied it, if there is no code difference, can we just leave what I have already committed in the tree?

thanks,

greg k-h

#3 lore raw
Quoted 28 lines · Greg Kroah-Hartman
Quoted 26 lines · Takashi Iwai
Quoted 23 lines · Takashi Iwai

From: Mauro Rossi <[email protected]>

fw_{grow,map}_paged_buf() need to be defined as static inline when CONFIG_FW_LOADER_PAGED_BUF is not enabled, infact fw_free_paged_buf() is also defined as static inline when CONFIG_FW_LOADER_PAGED_BUF is not enabled.

Fixes the following mutiple definition building errors for Android kernel:

drivers/base/firmware_loader/fallback_efi.o: In function `fw_grow_paged_buf':
fallback_efi.c:(.text+0x0): multiple definition of fw_grow_paged_buf' drivers/base/firmware_loader/main.o:(.text+0x73b): first defined here drivers/base/firmware_loader/fallback_efi.o: In function fw_map_paged_buf':
fallback_efi.c:(.text+0xf): multiple definition of `fw_map_paged_buf' drivers/base/firmware_loader/main.o:(.text+0x74a): first defined here

[ slightly corrected the patch description -- tiwai ]

Fixes 5342e7093ff2 ("firmware: Factor out the paged buffer handling code")
Fixes 82fd7a8142a1 ("firmware: Add support for loading compressed files")
Quoted 7 lines
Quoted 4 lines

Please discard this one. It's missing the inline, as Mauro already suggested in another mail.

Will resubmit the revised one. Sorry for inconvenience.

Ugh, I already applied it, if there is no code difference, can we just leave what I have already committed in the tree?

Well, the compiler would optimize it out, so the binary would be almost same, but it's still ugly to keep the obvious mistake there... If necessary, I'll resubmit a patch on top of the first version to correct that.

thanks,

Takashi