Skip to contentSkip to conversation

arm: armv8: Fix warning about redeclaring global functions as weak

PATCH In review Tom Rini 1 participant 2 messages Jun 29, 2021 – Jul 10, 2021 Arm (32-bit)

lore
Share & tools
lore

Tom Rini

author
#0 lore raw

PATCH 1/1 arm: armv8: Fix warning about redeclaring global functions as weak

As seen with clang-12:
warning: __asm_invalidate_l3_dcache changed binding to STB_WEAK

As we indeed use ENTRY and then declare the function weak manually. Use the WEAK declarative from <linux/linkage.h> instead.

---
 arch/arm/cpu/armv8/cache.S | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
arch/arm/cpu/armv8/cache.S +3 -6
index 443d94c262a0..e04907dd8c0b 100644
@@ -188,27 +188,24 @@ ENDPROC(__asm_invalidate_icache_all)
 .popsection
 
 .pushsection .text.__asm_invalidate_l3_dcache, "ax"
-ENTRY(__asm_invalidate_l3_dcache)
+WEAK(__asm_invalidate_l3_dcache)
 	mov	x0, #0			/* return status as success */
 	ret
 ENDPROC(__asm_invalidate_l3_dcache)
-	.weak	__asm_invalidate_l3_dcache
 .popsection
 
 .pushsection .text.__asm_flush_l3_dcache, "ax"
-ENTRY(__asm_flush_l3_dcache)
+WEAK(__asm_flush_l3_dcache)
 	mov	x0, #0			/* return status as success */
 	ret
 ENDPROC(__asm_flush_l3_dcache)
-	.weak	__asm_flush_l3_dcache
 .popsection
 
 .pushsection .text.__asm_invalidate_l3_icache, "ax"
-ENTRY(__asm_invalidate_l3_icache)
+WEAK(__asm_invalidate_l3_icache)
 	mov	x0, #0			/* return status as success */
 	ret
 ENDPROC(__asm_invalidate_l3_icache)
-	.weak	__asm_invalidate_l3_icache
 .popsection
 
 /*
Signature · 1 line
2.17.1
author
#1 lore raw
Quoted 7 lines · Tom Rini

As seen with clang-12:
warning: __asm_invalidate_l3_dcache changed binding to STB_WEAK

As we indeed use ENTRY and then declare the function weak manually. Use the WEAK declarative from <linux/linkage.h> instead.

Applied to u-boot/master, thanks!

Signature · 1 line
Tom