Skip to content

Commit 6a527b6

Browse files
riscv: init: merge split string literals in preprocessor directive
sparse complains loudly when string literals associated with preprocessor directives are split into multiple, separately quoted strings across different lines: arch/riscv/mm/init.c:341:9: error: Expected ; at the end of type declaration arch/riscv/mm/init.c:341:9: error: got "not use absolute addressing." arch/riscv/mm/init.c:358:9: error: Trying to use reserved word 'do' as identifier arch/riscv/mm/init.c:358:9: error: Expected ; at end of declaration [ ... ] It turns out this doesn't compile. The existing Linux practice for this situation is simply to use a single long line. So, fix by concatenating the strings. This patch should have no functional impact. This version incorporates changes based on feedback from Luc Van Oostenryck <[email protected]>. Signed-off-by: Paul Walmsley <[email protected]> Reviewed-by: Luc Van Oostenryck <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Link: https://lore.kernel.org/linux-riscv/CAAhSdy2nX2LwEEAZuMtW_ByGTkHO6KaUEvVxRnba_ENEjmFayQ@mail.gmail.com/T/#mc1a58bc864f71278123d19a7abc083a9c8e37033 Fixes: 387181d ("RISC-V: Always compile mm/init.c with cmodel=medany and notrace") Cc: Anup Patel <[email protected]>
1 parent ffaee27 commit 6a527b6

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

arch/riscv/mm/init.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,8 +339,7 @@ static uintptr_t __init best_map_size(phys_addr_t base, phys_addr_t size)
339339
*/
340340

341341
#ifndef __riscv_cmodel_medany
342-
#error "setup_vm() is called from head.S before relocate so it should "
343-
"not use absolute addressing."
342+
#error "setup_vm() is called from head.S before relocate so it should not use absolute addressing."
344343
#endif
345344

346345
asmlinkage void __init setup_vm(uintptr_t dtb_pa)

0 commit comments

Comments
 (0)