diff mbox series

[1/3] MIPS: Always define builtin_cmdline

Message ID 20191012204326.2564623-1-paul.burton@mips.com (mailing list archive)
State Mainlined
Commit b7340422cc16c5deff100812f38114bb5ec81203
Delegated to: Paul Burton
Headers show
Series [1/3] MIPS: Always define builtin_cmdline | expand

Commit Message

Paul Burton Oct. 12, 2019, 8:43 p.m. UTC
Commit 7784cac69735 ("MIPS: cmdline: Clean up boot_command_line
initialization") made use of builtin_cmdline conditional upon plain C if
statements rather than preprocessor #ifdef's. This caused build failures
for configurations with CONFIG_CMDLINE_BOOL=n where builtin_cmdline
wasn't defined, for example:

   arch/mips/kernel/setup.c: In function 'bootcmdline_init':
>> arch/mips/kernel/setup.c:582:30: error: 'builtin_cmdline' undeclared
    (first use in this function); did you mean 'builtin_driver'?
      strlcpy(boot_command_line, builtin_cmdline, COMMAND_LINE_SIZE);
                                 ^~~~~~~~~~~~~~~
                                 builtin_driver
   arch/mips/kernel/setup.c:582:30: note: each undeclared identifier is
    reported only once for each function it appears in

Fix this by defining builtin_cmdline as an empty string in the affected
configurations. All of the paths that use it should be optimized out
anyway so the data itself gets optimized away too.

Signed-off-by: Paul Burton <paul.burton@mips.com>
Fixes: 7784cac69735 ("MIPS: cmdline: Clean up boot_command_line initialization")
Reported-by: kbuild test robot <lkp@intel.com>
Reported-by: Nathan Chancellor <natechancellor@gmail.com>
---

 arch/mips/kernel/setup.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Paul Burton Oct. 13, 2019, 3:31 a.m. UTC | #1
Hello,

Paul Burton wrote:
> Commit 7784cac69735 ("MIPS: cmdline: Clean up boot_command_line
> initialization") made use of builtin_cmdline conditional upon plain C if
> statements rather than preprocessor #ifdef's. This caused build failures
> for configurations with CONFIG_CMDLINE_BOOL=n where builtin_cmdline
> wasn't defined, for example:
> 
>    arch/mips/kernel/setup.c: In function 'bootcmdline_init':
> >> arch/mips/kernel/setup.c:582:30: error: 'builtin_cmdline' undeclared
>     (first use in this function); did you mean 'builtin_driver'?
>       strlcpy(boot_command_line, builtin_cmdline, COMMAND_LINE_SIZE);
>                                  ^~~~~~~~~~~~~~~
>                                  builtin_driver
>    arch/mips/kernel/setup.c:582:30: note: each undeclared identifier is
>     reported only once for each function it appears in
> 
> Fix this by defining builtin_cmdline as an empty string in the affected
> configurations. All of the paths that use it should be optimized out
> anyway so the data itself gets optimized away too.

Series applied to mips-next.

> MIPS: Always define builtin_cmdline
>   commit b7340422cc16
>   https://git.kernel.org/mips/c/b7340422cc16
>   
>   Signed-off-by: Paul Burton <paul.burton@mips.com>
>   Fixes: 7784cac69735 ("MIPS: cmdline: Clean up boot_command_line initialization")
>   Reported-by: kbuild test robot <lkp@intel.com>
>   Reported-by: Nathan Chancellor <natechancellor@gmail.com>
> 
> MIPS: Fix CONFIG_OF_EARLY_FLATTREE=n builds
>   commit 972727766ee4
>   https://git.kernel.org/mips/c/972727766ee4
>   
>   Signed-off-by: Paul Burton <paul.burton@mips.com>
>   Fixes: 7784cac69735 ("MIPS: cmdline: Clean up boot_command_line initialization")
>   Reported-by: kbuild test robot <lkp@intel.com>
> 
> MIPS: Make builtin_cmdline const & variable length
>   commit 9dd422f69777
>   https://git.kernel.org/mips/c/9dd422f69777
>   
>   Signed-off-by: Paul Burton <paul.burton@mips.com>

Thanks,
    Paul

[ This message was auto-generated; if you believe anything is incorrect
  then please email paul.burton@mips.com to report it. ]
diff mbox series

Patch

diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
index 4aeba3122972..119999d31558 100644
--- a/arch/mips/kernel/setup.c
+++ b/arch/mips/kernel/setup.c
@@ -68,6 +68,8 @@  char __initdata arcs_cmdline[COMMAND_LINE_SIZE];
 
 #ifdef CONFIG_CMDLINE_BOOL
 static char __initdata builtin_cmdline[COMMAND_LINE_SIZE] = CONFIG_CMDLINE;
+#else
+static const char builtin_cmdline[] __initconst = "";
 #endif
 
 /*