Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

nios2: Fix unused variable warning

Fix the following compiler splat by adding __maybe_unused annotation to
the variable. Using this particular annotation has the least ugly impact
on the code compared to using ifdeffery.

arch/nios2/kernel/setup.c: In function 'nios2_boot_init':
arch/nios2/kernel/setup.c:107:7: warning: unused variable 'cmdline_passed' [-Wunused-variable]
char cmdline_passed[COMMAND_LINE_SIZE] = { 0, };
^

Signed-off-by: Marek Vasut <marex@denx.de>
Acked-by: Ley Foon Tan <lftan@altera.com>

authored by

Marek Vasut and committed by
Ley Foon Tan
4db2196d 6a13feb9

+1 -1
+1 -1
arch/nios2/kernel/setup.c
··· 104 104 unsigned r7) 105 105 { 106 106 unsigned dtb_passed = 0; 107 - char cmdline_passed[COMMAND_LINE_SIZE] = { 0, }; 107 + char cmdline_passed[COMMAND_LINE_SIZE] __maybe_unused = { 0, }; 108 108 109 109 #if defined(CONFIG_NIOS2_PASS_CMDLINE) 110 110 if (r4 == 0x534f494e) { /* r4 is magic NIOS */