* [U-Boot] [PATCH] common/spl: Mark arguments as unused
@ 2012-10-23 10:05 Vikram Narayanan
2012-10-23 10:26 ` Stefan Roese
0 siblings, 1 reply; 11+ messages in thread
From: Vikram Narayanan @ 2012-10-23 10:05 UTC (permalink / raw)
To: u-boot
As dummy{1,2} are not used anywhere, mark it with __maybe_unused
Signed-off-by: Vikram Narayanan <vikram186@gmail.com>
Cc: Stefan Roese <sr@denx.de>
---
common/spl/spl.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/common/spl/spl.c b/common/spl/spl.c
index 0d829c0..62fd3bd 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -145,7 +145,7 @@ static void spl_ram_load_image(void)
}
#endif
-void board_init_r(gd_t *dummy1, ulong dummy2)
+void board_init_r(__maybe_unused gd_t *dummy1, __maybe_unused ulong dummy2)
{
u32 boot_device;
debug(">>spl:board_init_r()\n");
--
1.7.4.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [U-Boot] [PATCH] common/spl: Mark arguments as unused
2012-10-23 10:05 [U-Boot] [PATCH] common/spl: Mark arguments as unused Vikram Narayanan
@ 2012-10-23 10:26 ` Stefan Roese
2012-10-23 10:55 ` Vikram Narayanan
2012-10-23 15:45 ` Tom Rini
0 siblings, 2 replies; 11+ messages in thread
From: Stefan Roese @ 2012-10-23 10:26 UTC (permalink / raw)
To: u-boot
On 10/23/2012 12:05 PM, Vikram Narayanan wrote:
> As dummy{1,2} are not used anywhere, mark it with __maybe_unused
>
> Signed-off-by: Vikram Narayanan <vikram186@gmail.com>
> Cc: Stefan Roese <sr@denx.de>
> ---
> common/spl/spl.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/common/spl/spl.c b/common/spl/spl.c
> index 0d829c0..62fd3bd 100644
> --- a/common/spl/spl.c
> +++ b/common/spl/spl.c
> @@ -145,7 +145,7 @@ static void spl_ram_load_image(void)
> }
> #endif
>
> -void board_init_r(gd_t *dummy1, ulong dummy2)
> +void board_init_r(__maybe_unused gd_t *dummy1, __maybe_unused ulong dummy2)
> {
> u32 boot_device;
> debug(">>spl:board_init_r()\n");
>
Perhaps even __always_unused instead of __maybe_unused as these
variables are never used?
Thanks,
Stefan
^ permalink raw reply [flat|nested] 11+ messages in thread
* [U-Boot] [PATCH] common/spl: Mark arguments as unused
2012-10-23 10:26 ` Stefan Roese
@ 2012-10-23 10:55 ` Vikram Narayanan
2012-10-23 15:45 ` Tom Rini
1 sibling, 0 replies; 11+ messages in thread
From: Vikram Narayanan @ 2012-10-23 10:55 UTC (permalink / raw)
To: u-boot
On 10/23/2012 3:56 PM, Stefan Roese wrote:
> On 10/23/2012 12:05 PM, Vikram Narayanan wrote:
>> As dummy{1,2} are not used anywhere, mark it with __maybe_unused
>>
>> Signed-off-by: Vikram Narayanan<vikram186@gmail.com>
>> Cc: Stefan Roese<sr@denx.de>
>> ---
>> common/spl/spl.c | 2 +-
>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/common/spl/spl.c b/common/spl/spl.c
>> index 0d829c0..62fd3bd 100644
>> --- a/common/spl/spl.c
>> +++ b/common/spl/spl.c
>> @@ -145,7 +145,7 @@ static void spl_ram_load_image(void)
>> }
>> #endif
>>
>> -void board_init_r(gd_t *dummy1, ulong dummy2)
>> +void board_init_r(__maybe_unused gd_t *dummy1, __maybe_unused ulong dummy2)
>> {
>> u32 boot_device;
>> debug(">>spl:board_init_r()\n");
>>
>
> Perhaps even __always_unused instead of __maybe_unused as these
> variables are never used?
Yes. It is better, in the case if it is never used at all.
Thanks,
Vikram
^ permalink raw reply [flat|nested] 11+ messages in thread
* [U-Boot] [PATCH] common/spl: Mark arguments as unused
2012-10-23 10:26 ` Stefan Roese
2012-10-23 10:55 ` Vikram Narayanan
@ 2012-10-23 15:45 ` Tom Rini
2012-10-23 17:15 ` Vikram Narayanan
1 sibling, 1 reply; 11+ messages in thread
From: Tom Rini @ 2012-10-23 15:45 UTC (permalink / raw)
To: u-boot
On Tue, Oct 23, 2012 at 12:26:53PM +0200, Stefan Roese wrote:
> On 10/23/2012 12:05 PM, Vikram Narayanan wrote:
> > As dummy{1,2} are not used anywhere, mark it with __maybe_unused
> >
> > Signed-off-by: Vikram Narayanan <vikram186@gmail.com>
> > Cc: Stefan Roese <sr@denx.de>
> > ---
> > common/spl/spl.c | 2 +-
> > 1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/common/spl/spl.c b/common/spl/spl.c
> > index 0d829c0..62fd3bd 100644
> > --- a/common/spl/spl.c
> > +++ b/common/spl/spl.c
> > @@ -145,7 +145,7 @@ static void spl_ram_load_image(void)
> > }
> > #endif
> >
> > -void board_init_r(gd_t *dummy1, ulong dummy2)
> > +void board_init_r(__maybe_unused gd_t *dummy1, __maybe_unused ulong dummy2)
> > {
> > u32 boot_device;
> > debug(">>spl:board_init_r()\n");
> >
>
> Perhaps even __always_unused instead of __maybe_unused as these
> variables are never used?
Also, what does this give us? Fixing a sparse warning?
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20121023/9c8bf30b/attachment.pgp>
^ permalink raw reply [flat|nested] 11+ messages in thread
* [U-Boot] [PATCH] common/spl: Mark arguments as unused
2012-10-23 15:45 ` Tom Rini
@ 2012-10-23 17:15 ` Vikram Narayanan
2012-10-24 1:52 ` Scott Wood
0 siblings, 1 reply; 11+ messages in thread
From: Vikram Narayanan @ 2012-10-23 17:15 UTC (permalink / raw)
To: u-boot
On 10/23/2012 9:15 PM, Tom Rini wrote:
> On Tue, Oct 23, 2012 at 12:26:53PM +0200, Stefan Roese wrote:
>> On 10/23/2012 12:05 PM, Vikram Narayanan wrote:
>>> As dummy{1,2} are not used anywhere, mark it with __maybe_unused
>>>
>>> Signed-off-by: Vikram Narayanan<vikram186@gmail.com>
>>> Cc: Stefan Roese<sr@denx.de>
>>> ---
>>> common/spl/spl.c | 2 +-
>>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/common/spl/spl.c b/common/spl/spl.c
>>> index 0d829c0..62fd3bd 100644
>>> --- a/common/spl/spl.c
>>> +++ b/common/spl/spl.c
>>> @@ -145,7 +145,7 @@ static void spl_ram_load_image(void)
>>> }
>>> #endif
>>>
>>> -void board_init_r(gd_t *dummy1, ulong dummy2)
>>> +void board_init_r(__maybe_unused gd_t *dummy1, __maybe_unused ulong dummy2)
>>> {
>>> u32 boot_device;
>>> debug(">>spl:board_init_r()\n");
>>>
>>
>> Perhaps even __always_unused instead of __maybe_unused as these
>> variables are never used?
>
> Also, what does this give us? Fixing a sparse warning?
Not a sparse warning. I noticed this while looking at the code.
~Vikram
^ permalink raw reply [flat|nested] 11+ messages in thread
* [U-Boot] [PATCH] common/spl: Mark arguments as unused
2012-10-23 17:15 ` Vikram Narayanan
@ 2012-10-24 1:52 ` Scott Wood
2012-10-24 4:14 ` Vikram Narayanan
0 siblings, 1 reply; 11+ messages in thread
From: Scott Wood @ 2012-10-24 1:52 UTC (permalink / raw)
To: u-boot
On 10/23/2012 12:15:11 PM, Vikram Narayanan wrote:
> On 10/23/2012 9:15 PM, Tom Rini wrote:
>> On Tue, Oct 23, 2012 at 12:26:53PM +0200, Stefan Roese wrote:
>>> On 10/23/2012 12:05 PM, Vikram Narayanan wrote:
>>>> As dummy{1,2} are not used anywhere, mark it with __maybe_unused
>>>>
>>>> Signed-off-by: Vikram Narayanan<vikram186@gmail.com>
>>>> Cc: Stefan Roese<sr@denx.de>
>>>> ---
>>>> common/spl/spl.c | 2 +-
>>>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>>>
>>>> diff --git a/common/spl/spl.c b/common/spl/spl.c
>>>> index 0d829c0..62fd3bd 100644
>>>> --- a/common/spl/spl.c
>>>> +++ b/common/spl/spl.c
>>>> @@ -145,7 +145,7 @@ static void spl_ram_load_image(void)
>>>> }
>>>> #endif
>>>>
>>>> -void board_init_r(gd_t *dummy1, ulong dummy2)
>>>> +void board_init_r(__maybe_unused gd_t *dummy1, __maybe_unused
>>>> ulong dummy2)
>>>> {
>>>> u32 boot_device;
>>>> debug(">>spl:board_init_r()\n");
>>>>
>>>
>>> Perhaps even __always_unused instead of __maybe_unused as these
>>> variables are never used?
>>
>> Also, what does this give us? Fixing a sparse warning?
>
> Not a sparse warning. I noticed this while looking at the code.
If there's no warning, why do we need to ugly up the code with
__maybe_unused?
Unused arguments are quite common, as a result of implementing a common
interface where this implementation doesn't need all the information
that the interface provides. It should not cause a warning and should
not require annotation.
-Scott
^ permalink raw reply [flat|nested] 11+ messages in thread
* [U-Boot] [PATCH] common/spl: Mark arguments as unused
2012-10-24 1:52 ` Scott Wood
@ 2012-10-24 4:14 ` Vikram Narayanan
2012-10-24 17:11 ` Scott Wood
0 siblings, 1 reply; 11+ messages in thread
From: Vikram Narayanan @ 2012-10-24 4:14 UTC (permalink / raw)
To: u-boot
On 10/24/2012 7:22 AM, Scott Wood wrote:
> On 10/23/2012 12:15:11 PM, Vikram Narayanan wrote:
>> On 10/23/2012 9:15 PM, Tom Rini wrote:
>>> On Tue, Oct 23, 2012 at 12:26:53PM +0200, Stefan Roese wrote:
>>>> On 10/23/2012 12:05 PM, Vikram Narayanan wrote:
>>>>> As dummy{1,2} are not used anywhere, mark it with __maybe_unused
>>>>>
>>>>> Signed-off-by: Vikram Narayanan<vikram186@gmail.com>
>>>>> Cc: Stefan Roese<sr@denx.de>
>>>>> ---
>>>>> common/spl/spl.c | 2 +-
>>>>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>>>>
>>>>> diff --git a/common/spl/spl.c b/common/spl/spl.c
>>>>> index 0d829c0..62fd3bd 100644
>>>>> --- a/common/spl/spl.c
>>>>> +++ b/common/spl/spl.c
>>>>> @@ -145,7 +145,7 @@ static void spl_ram_load_image(void)
>>>>> }
>>>>> #endif
>>>>>
>>>>> -void board_init_r(gd_t *dummy1, ulong dummy2)
>>>>> +void board_init_r(__maybe_unused gd_t *dummy1, __maybe_unused
>>>>> ulong dummy2)
>>>>> {
>>>>> u32 boot_device;
>>>>> debug(">>spl:board_init_r()\n");
>>>>>
>>>>
>>>> Perhaps even __always_unused instead of __maybe_unused as these
>>>> variables are never used?
>>>
>>> Also, what does this give us? Fixing a sparse warning?
>>
>> Not a sparse warning. I noticed this while looking at the code.
>
> If there's no warning, why do we need to ugly up the code with
> __maybe_unused?
I'd rather call this a proper way of coding, than calling it ugly. But
perceptions differ.
> Unused arguments are quite common, as a result of implementing a common
> interface where this implementation doesn't need all the information
> that the interface provides. It should not cause a warning and should
> not require annotation.
~Vikram
^ permalink raw reply [flat|nested] 11+ messages in thread
* [U-Boot] [PATCH] common/spl: Mark arguments as unused
2012-10-24 4:14 ` Vikram Narayanan
@ 2012-10-24 17:11 ` Scott Wood
2012-10-28 17:04 ` Vikram Narayanan
0 siblings, 1 reply; 11+ messages in thread
From: Scott Wood @ 2012-10-24 17:11 UTC (permalink / raw)
To: u-boot
On 10/23/2012 11:14:34 PM, Vikram Narayanan wrote:
> On 10/24/2012 7:22 AM, Scott Wood wrote:
>> On 10/23/2012 12:15:11 PM, Vikram Narayanan wrote:
>>> On 10/23/2012 9:15 PM, Tom Rini wrote:
>>>> On Tue, Oct 23, 2012 at 12:26:53PM +0200, Stefan Roese wrote:
>>>>> On 10/23/2012 12:05 PM, Vikram Narayanan wrote:
>>>>>> As dummy{1,2} are not used anywhere, mark it with __maybe_unused
>>>>>>
>>>>>> Signed-off-by: Vikram Narayanan<vikram186@gmail.com>
>>>>>> Cc: Stefan Roese<sr@denx.de>
>>>>>> ---
>>>>>> common/spl/spl.c | 2 +-
>>>>>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>>>>>
>>>>>> diff --git a/common/spl/spl.c b/common/spl/spl.c
>>>>>> index 0d829c0..62fd3bd 100644
>>>>>> --- a/common/spl/spl.c
>>>>>> +++ b/common/spl/spl.c
>>>>>> @@ -145,7 +145,7 @@ static void spl_ram_load_image(void)
>>>>>> }
>>>>>> #endif
>>>>>>
>>>>>> -void board_init_r(gd_t *dummy1, ulong dummy2)
>>>>>> +void board_init_r(__maybe_unused gd_t *dummy1, __maybe_unused
>>>>>> ulong dummy2)
>>>>>> {
>>>>>> u32 boot_device;
>>>>>> debug(">>spl:board_init_r()\n");
>>>>>>
>>>>>
>>>>> Perhaps even __always_unused instead of __maybe_unused as these
>>>>> variables are never used?
>>>>
>>>> Also, what does this give us? Fixing a sparse warning?
>>>
>>> Not a sparse warning. I noticed this while looking at the code.
>>
>> If there's no warning, why do we need to ugly up the code with
>> __maybe_unused?
>
> I'd rather call this a proper way of coding, than calling it ugly.
> But perceptions differ.
If you want to push for a change to the official coding style, and
changing the warning options to go with it, go ahead (I'll argue
against it of course), but until and unless you succeed at that, this
isn't the way U-Boot code is written. I don't see a single instance of
__maybe_unused in an argument list, or a single instance of
__always_unused anywhere in U-Boot other than its definition.
Unnecessary clutter is harmful to readability.
-Scott
^ permalink raw reply [flat|nested] 11+ messages in thread
* [U-Boot] [PATCH] common/spl: Mark arguments as unused
2012-10-24 17:11 ` Scott Wood
@ 2012-10-28 17:04 ` Vikram Narayanan
2012-10-29 16:34 ` Scott Wood
0 siblings, 1 reply; 11+ messages in thread
From: Vikram Narayanan @ 2012-10-28 17:04 UTC (permalink / raw)
To: u-boot
On 10/24/2012 10:41 PM, Scott Wood wrote:
> On 10/23/2012 11:14:34 PM, Vikram Narayanan wrote:
>> On 10/24/2012 7:22 AM, Scott Wood wrote:
>>> On 10/23/2012 12:15:11 PM, Vikram Narayanan wrote:
>>>> On 10/23/2012 9:15 PM, Tom Rini wrote:
>>>>> On Tue, Oct 23, 2012 at 12:26:53PM +0200, Stefan Roese wrote:
>>>>>> On 10/23/2012 12:05 PM, Vikram Narayanan wrote:
>>>>>>> As dummy{1,2} are not used anywhere, mark it with __maybe_unused
>>>>>>>
>>>>>>> Signed-off-by: Vikram Narayanan<vikram186@gmail.com>
>>>>>>> Cc: Stefan Roese<sr@denx.de>
>>>>>>> ---
>>>>>>> common/spl/spl.c | 2 +-
>>>>>>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>>>>>>
>>>>>>> diff --git a/common/spl/spl.c b/common/spl/spl.c
>>>>>>> index 0d829c0..62fd3bd 100644
>>>>>>> --- a/common/spl/spl.c
>>>>>>> +++ b/common/spl/spl.c
>>>>>>> @@ -145,7 +145,7 @@ static void spl_ram_load_image(void)
>>>>>>> }
>>>>>>> #endif
>>>>>>>
>>>>>>> -void board_init_r(gd_t *dummy1, ulong dummy2)
>>>>>>> +void board_init_r(__maybe_unused gd_t *dummy1, __maybe_unused
>>>>>>> ulong dummy2)
>>>>>>> {
>>>>>>> u32 boot_device;
>>>>>>> debug(">>spl:board_init_r()\n");
>>>>>>>
>>>>>>
>>>>>> Perhaps even __always_unused instead of __maybe_unused as these
>>>>>> variables are never used?
>>>>>
>>>>> Also, what does this give us? Fixing a sparse warning?
>>>>
>>>> Not a sparse warning. I noticed this while looking at the code.
>>>
>>> If there's no warning, why do we need to ugly up the code with
>>> __maybe_unused?
>>
>> I'd rather call this a proper way of coding, than calling it ugly. But
>> perceptions differ.
>
> If you want to push for a change to the official coding style, and
> changing the warning options to go with it, go ahead (I'll argue against
> it of course), but until and unless you succeed at that, this isn't the
> way U-Boot code is written. I don't see a single instance of
> __maybe_unused in an argument list, or a single instance of
> __always_unused anywhere in U-Boot other than its definition.
> Unnecessary clutter is harmful to readability.
It's not worth arguing over a single line of code that isn't going to
cause any significant change. That would save us both some time.
~Vikram
^ permalink raw reply [flat|nested] 11+ messages in thread
* [U-Boot] [PATCH] common/spl: Mark arguments as unused
2012-10-28 17:04 ` Vikram Narayanan
@ 2012-10-29 16:34 ` Scott Wood
2012-10-29 18:54 ` Vikram Narayanan
0 siblings, 1 reply; 11+ messages in thread
From: Scott Wood @ 2012-10-29 16:34 UTC (permalink / raw)
To: u-boot
On 10/28/2012 12:04:06 PM, Vikram Narayanan wrote:
> On 10/24/2012 10:41 PM, Scott Wood wrote:
>> On 10/23/2012 11:14:34 PM, Vikram Narayanan wrote:
>>> On 10/24/2012 7:22 AM, Scott Wood wrote:
>>>> On 10/23/2012 12:15:11 PM, Vikram Narayanan wrote:
>>>>> On 10/23/2012 9:15 PM, Tom Rini wrote:
>>>>>> On Tue, Oct 23, 2012 at 12:26:53PM +0200, Stefan Roese wrote:
>>>>>>> On 10/23/2012 12:05 PM, Vikram Narayanan wrote:
>>>>>>>> As dummy{1,2} are not used anywhere, mark it with
>>>>>>>> __maybe_unused
>>>>>>>>
>>>>>>>> Signed-off-by: Vikram Narayanan<vikram186@gmail.com>
>>>>>>>> Cc: Stefan Roese<sr@denx.de>
>>>>>>>> ---
>>>>>>>> common/spl/spl.c | 2 +-
>>>>>>>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>>>>>>>
>>>>>>>> diff --git a/common/spl/spl.c b/common/spl/spl.c
>>>>>>>> index 0d829c0..62fd3bd 100644
>>>>>>>> --- a/common/spl/spl.c
>>>>>>>> +++ b/common/spl/spl.c
>>>>>>>> @@ -145,7 +145,7 @@ static void spl_ram_load_image(void)
>>>>>>>> }
>>>>>>>> #endif
>>>>>>>>
>>>>>>>> -void board_init_r(gd_t *dummy1, ulong dummy2)
>>>>>>>> +void board_init_r(__maybe_unused gd_t *dummy1, __maybe_unused
>>>>>>>> ulong dummy2)
>>>>>>>> {
>>>>>>>> u32 boot_device;
>>>>>>>> debug(">>spl:board_init_r()\n");
>>>>>>>>
>>>>>>>
>>>>>>> Perhaps even __always_unused instead of __maybe_unused as these
>>>>>>> variables are never used?
>>>>>>
>>>>>> Also, what does this give us? Fixing a sparse warning?
>>>>>
>>>>> Not a sparse warning. I noticed this while looking at the code.
>>>>
>>>> If there's no warning, why do we need to ugly up the code with
>>>> __maybe_unused?
>>>
>>> I'd rather call this a proper way of coding, than calling it ugly.
>>> But
>>> perceptions differ.
>>
>> If you want to push for a change to the official coding style, and
>> changing the warning options to go with it, go ahead (I'll argue
>> against
>> it of course), but until and unless you succeed at that, this isn't
>> the
>> way U-Boot code is written. I don't see a single instance of
>> __maybe_unused in an argument list, or a single instance of
>> __always_unused anywhere in U-Boot other than its definition.
>> Unnecessary clutter is harmful to readability.
>
> It's not worth arguing over a single line of code that isn't going to
> cause any significant change. That would save us both some time.
So you're withdrawing the patch?
I'm more concerned about the precedent it sets than the one specific
line.
-Scott
^ permalink raw reply [flat|nested] 11+ messages in thread
* [U-Boot] [PATCH] common/spl: Mark arguments as unused
2012-10-29 16:34 ` Scott Wood
@ 2012-10-29 18:54 ` Vikram Narayanan
0 siblings, 0 replies; 11+ messages in thread
From: Vikram Narayanan @ 2012-10-29 18:54 UTC (permalink / raw)
To: u-boot
On 10/29/2012 10:04 PM, Scott Wood wrote:
>>
>> It's not worth arguing over a single line of code that isn't going to
>> cause any significant change. That would save us both some time.
>
> So you're withdrawing the patch?
Yes.
> I'm more concerned about the precedent it sets than the one specific line.
Agree with your concern.
~Vikram
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2012-10-29 18:54 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-23 10:05 [U-Boot] [PATCH] common/spl: Mark arguments as unused Vikram Narayanan
2012-10-23 10:26 ` Stefan Roese
2012-10-23 10:55 ` Vikram Narayanan
2012-10-23 15:45 ` Tom Rini
2012-10-23 17:15 ` Vikram Narayanan
2012-10-24 1:52 ` Scott Wood
2012-10-24 4:14 ` Vikram Narayanan
2012-10-24 17:11 ` Scott Wood
2012-10-28 17:04 ` Vikram Narayanan
2012-10-29 16:34 ` Scott Wood
2012-10-29 18:54 ` Vikram Narayanan
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.