* [PATCH] nios2: Fix unused variable warning
@ 2015-09-19 4:40 Marek Vasut
2015-09-22 15:22 ` Tobias Klauser
0 siblings, 1 reply; 3+ messages in thread
From: Marek Vasut @ 2015-09-19 4:40 UTC (permalink / raw)
To: linux-kernel; +Cc: lftan, Marek Vasut
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>
---
arch/nios2/kernel/setup.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/nios2/kernel/setup.c b/arch/nios2/kernel/setup.c
index b101a43..a4ff86d 100644
--- a/arch/nios2/kernel/setup.c
+++ b/arch/nios2/kernel/setup.c
@@ -104,7 +104,7 @@ asmlinkage void __init nios2_boot_init(unsigned r4, unsigned r5, unsigned r6,
unsigned r7)
{
unsigned dtb_passed = 0;
- char cmdline_passed[COMMAND_LINE_SIZE] = { 0, };
+ char cmdline_passed[COMMAND_LINE_SIZE] __maybe_unused = { 0, };
#if defined(CONFIG_NIOS2_PASS_CMDLINE)
if (r4 == 0x534f494e) { /* r4 is magic NIOS */
--
2.1.4
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] nios2: Fix unused variable warning
2015-09-19 4:40 [PATCH] nios2: Fix unused variable warning Marek Vasut
@ 2015-09-22 15:22 ` Tobias Klauser
2015-10-01 8:10 ` Ley Foon Tan
0 siblings, 1 reply; 3+ messages in thread
From: Tobias Klauser @ 2015-09-22 15:22 UTC (permalink / raw)
To: Marek Vasut; +Cc: linux-kernel, lftan
On 2015-09-19 at 06:40:51 +0200, Marek Vasut <marex@denx.de> wrote:
> 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>
Reviewed-by: Tobias Klauser <tklauser@distanz.ch>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] nios2: Fix unused variable warning
2015-09-22 15:22 ` Tobias Klauser
@ 2015-10-01 8:10 ` Ley Foon Tan
0 siblings, 0 replies; 3+ messages in thread
From: Ley Foon Tan @ 2015-10-01 8:10 UTC (permalink / raw)
To: Tobias Klauser; +Cc: Marek Vasut, linux-kernel
On Tue, Sep 22, 2015 at 11:22 PM, Tobias Klauser <tklauser@distanz.ch> wrote:
> On 2015-09-19 at 06:40:51 +0200, Marek Vasut <marex@denx.de> wrote:
>> 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>
>
> Reviewed-by: Tobias Klauser <tklauser@distanz.ch>
> --
Acked-by: Ley Foon Tan <lftan@altera.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-10-01 8:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-19 4:40 [PATCH] nios2: Fix unused variable warning Marek Vasut
2015-09-22 15:22 ` Tobias Klauser
2015-10-01 8:10 ` Ley Foon Tan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®