* [PATCH] Mark prop unused in early_init_dt_scan_chosen().
@ 2007-05-08 17:14 Scott Wood
2007-05-08 23:56 ` Michael Ellerman
2007-05-10 3:39 ` Kumar Gala
0 siblings, 2 replies; 7+ messages in thread
From: Scott Wood @ 2007-05-08 17:14 UTC (permalink / raw)
To: paulus; +Cc: linuxppc-dev
The prop variable is only referenced when initrd support is
turned on.
Signed-off-by: Scott Wood <scottwood@freescale.com>
---
arch/powerpc/kernel/prom.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index caef555..6705459 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -720,7 +720,7 @@ static int __init early_init_dt_scan_chosen(unsigned long node,
const char *uname, int depth, void *data)
{
unsigned long *lprop;
- u32 *prop;
+ u32 __attribute__((unused)) *prop;
unsigned long l;
char *p;
--
1.5.0.3
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] Mark prop unused in early_init_dt_scan_chosen().
2007-05-08 17:14 [PATCH] Mark prop unused in early_init_dt_scan_chosen() Scott Wood
@ 2007-05-08 23:56 ` Michael Ellerman
2007-05-09 0:41 ` David Gibson
2007-05-10 3:39 ` Kumar Gala
1 sibling, 1 reply; 7+ messages in thread
From: Michael Ellerman @ 2007-05-08 23:56 UTC (permalink / raw)
To: Scott Wood; +Cc: linuxppc-dev list
[-- Attachment #1: Type: text/plain, Size: 1129 bytes --]
On Tue, 2007-05-08 at 12:14 -0500, Scott Wood wrote:
> The prop variable is only referenced when initrd support is
> turned on.
>
> Signed-off-by: Scott Wood <scottwood@freescale.com>
> ---
> arch/powerpc/kernel/prom.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
> index caef555..6705459 100644
> --- a/arch/powerpc/kernel/prom.c
> +++ b/arch/powerpc/kernel/prom.c
> @@ -720,7 +720,7 @@ static int __init early_init_dt_scan_chosen(unsigned long node,
> const char *uname, int depth, void *data)
> {
> unsigned long *lprop;
> - u32 *prop;
> + u32 __attribute__((unused)) *prop;
> unsigned long l;
> char *p;
Hi Scott,
Let's be honest, this is a hack. I think it'd be cleaner to pull the
initrd logic out into a separate function.
cheers
--
Michael Ellerman
OzLabs, IBM Australia Development Lab
wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)
We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Mark prop unused in early_init_dt_scan_chosen().
2007-05-08 23:56 ` Michael Ellerman
@ 2007-05-09 0:41 ` David Gibson
0 siblings, 0 replies; 7+ messages in thread
From: David Gibson @ 2007-05-09 0:41 UTC (permalink / raw)
To: Michael Ellerman; +Cc: linuxppc-dev list
[-- Attachment #1: Type: text/plain, Size: 1364 bytes --]
On Wed, May 09, 2007 at 09:56:34AM +1000, Michael Ellerman wrote:
> On Tue, 2007-05-08 at 12:14 -0500, Scott Wood wrote:
> > The prop variable is only referenced when initrd support is
> > turned on.
> >
> > Signed-off-by: Scott Wood <scottwood@freescale.com>
> > ---
> > arch/powerpc/kernel/prom.c | 2 +-
> > 1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
> > index caef555..6705459 100644
> > --- a/arch/powerpc/kernel/prom.c
> > +++ b/arch/powerpc/kernel/prom.c
> > @@ -720,7 +720,7 @@ static int __init early_init_dt_scan_chosen(unsigned long node,
> > const char *uname, int depth, void *data)
> > {
> > unsigned long *lprop;
> > - u32 *prop;
> > + u32 __attribute__((unused)) *prop;
> > unsigned long l;
> > char *p;
>
> Hi Scott,
>
> Let's be honest, this is a hack. I think it'd be cleaner to pull the
> initrd logic out into a separate function.
More speficially, if the variable ever really becomes unused, this
will continue to suppress the warning. I'd be happied with an #ifdef
initrd around it, ugly though that is.
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Mark prop unused in early_init_dt_scan_chosen().
2007-05-08 17:14 [PATCH] Mark prop unused in early_init_dt_scan_chosen() Scott Wood
2007-05-08 23:56 ` Michael Ellerman
@ 2007-05-10 3:39 ` Kumar Gala
2007-05-10 7:39 ` Geert Uytterhoeven
1 sibling, 1 reply; 7+ messages in thread
From: Kumar Gala @ 2007-05-10 3:39 UTC (permalink / raw)
To: Scott Wood; +Cc: linuxppc-dev, paulus
On Tue, 8 May 2007, Scott Wood wrote:
> The prop variable is only referenced when initrd support is
> turned on.
>
> Signed-off-by: Scott Wood <scottwood@freescale.com>
> ---
> arch/powerpc/kernel/prom.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
> index caef555..6705459 100644
> --- a/arch/powerpc/kernel/prom.c
> +++ b/arch/powerpc/kernel/prom.c
> @@ -720,7 +720,7 @@ static int __init early_init_dt_scan_chosen(unsigned long node,
> const char *uname, int depth, void *data)
> {
> unsigned long *lprop;
> - u32 *prop;
> + u32 __attribute__((unused)) *prop;
is this the desired way to remove warnings related to CONFIG_ options? I
know in the past we'd wrap it with a #ifdef CONFIG_FOO
> unsigned long l;
> char *p;
>
>
- k
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Mark prop unused in early_init_dt_scan_chosen().
2007-05-10 3:39 ` Kumar Gala
@ 2007-05-10 7:39 ` Geert Uytterhoeven
2007-05-10 15:54 ` Scott Wood
0 siblings, 1 reply; 7+ messages in thread
From: Geert Uytterhoeven @ 2007-05-10 7:39 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev, paulus
On Wed, 9 May 2007, Kumar Gala wrote:
> On Tue, 8 May 2007, Scott Wood wrote:
> > The prop variable is only referenced when initrd support is
> > turned on.
> >
> > Signed-off-by: Scott Wood <scottwood@freescale.com>
> > ---
> > arch/powerpc/kernel/prom.c | 2 +-
> > 1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
> > index caef555..6705459 100644
> > --- a/arch/powerpc/kernel/prom.c
> > +++ b/arch/powerpc/kernel/prom.c
> > @@ -720,7 +720,7 @@ static int __init early_init_dt_scan_chosen(unsigned long node,
> > const char *uname, int depth, void *data)
> > {
> > unsigned long *lprop;
> > - u32 *prop;
> > + u32 __attribute__((unused)) *prop;
>
> is this the desired way to remove warnings related to CONFIG_ options? I
> know in the past we'd wrap it with a #ifdef CONFIG_FOO
Exactly my thought.
Another advantage of #ifdef CONFIG_FOO is that if the actual code that uses it
goes away, we'll get a warning again. Else in the end we'll be stuck with
zillions of unused variables that don't cause warnings...
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- Sony Network and Software Technology Center Europe (NSCE)
Geert.Uytterhoeven@sonycom.com ------- The Corporate Village, Da Vincilaan 7-D1
Voice +32-2-7008453 Fax +32-2-7008622 ---------------- B-1935 Zaventem, Belgium
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Mark prop unused in early_init_dt_scan_chosen().
2007-05-10 7:39 ` Geert Uytterhoeven
@ 2007-05-10 15:54 ` Scott Wood
2007-05-10 16:06 ` Geert Uytterhoeven
0 siblings, 1 reply; 7+ messages in thread
From: Scott Wood @ 2007-05-10 15:54 UTC (permalink / raw)
To: Geert Uytterhoeven; +Cc: linuxppc-dev, paulus
Geert Uytterhoeven wrote:
> On Wed, 9 May 2007, Kumar Gala wrote:
>>On Tue, 8 May 2007, Scott Wood wrote:
>>>- u32 *prop;
>>>+ u32 __attribute__((unused)) *prop;
>>
>>is this the desired way to remove warnings related to CONFIG_ options? I
>>know in the past we'd wrap it with a #ifdef CONFIG_FOO
Granted... in this case, it looked as if there could be potential for
using it for other things in the future as well. That, and the extra
ifdefs are ugly. :-)
> Exactly my thought.
>
> Another advantage of #ifdef CONFIG_FOO is that if the actual code that uses it
> goes away, we'll get a warning again. Else in the end we'll be stuck with
> zillions of unused variables that don't cause warnings...
Again, granted -- though I'd say the primary problem in that case is
functions that are too long to determine that by visual inspection alone.
I agree with Michael Ellerman that it'd be best to just factor the
initrd stuff out into its own function.
-Scott
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Mark prop unused in early_init_dt_scan_chosen().
2007-05-10 15:54 ` Scott Wood
@ 2007-05-10 16:06 ` Geert Uytterhoeven
0 siblings, 0 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2007-05-10 16:06 UTC (permalink / raw)
To: Scott Wood; +Cc: linuxppc-dev, paulus
On Thu, 10 May 2007, Scott Wood wrote:
> Geert Uytterhoeven wrote:
> > On Wed, 9 May 2007, Kumar Gala wrote:
> > > On Tue, 8 May 2007, Scott Wood wrote:
> > > > - u32 *prop;
> > > > + u32 __attribute__((unused)) *prop;
> > >
> > > is this the desired way to remove warnings related to CONFIG_ options? I
> > > know in the past we'd wrap it with a #ifdef CONFIG_FOO
>
> Granted... in this case, it looked as if there could be potential for using
> it for other things in the future as well. That, and the extra ifdefs are
> ugly. :-)
>
> > Exactly my thought.
> >
> > Another advantage of #ifdef CONFIG_FOO is that if the actual code that uses
> > it
> > goes away, we'll get a warning again. Else in the end we'll be stuck with
> > zillions of unused variables that don't cause warnings...
>
> Again, granted -- though I'd say the primary problem in that case is functions
> that are too long to determine that by visual inspection alone.
>
> I agree with Michael Ellerman that it'd be best to just factor the initrd
> stuff out into its own function.
Yes, Michael Ellerman's patch is an even better solution.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- Sony Network and Software Technology Center Europe (NSCE)
Geert.Uytterhoeven@sonycom.com ------- The Corporate Village, Da Vincilaan 7-D1
Voice +32-2-7008453 Fax +32-2-7008622 ---------------- B-1935 Zaventem, Belgium
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2007-05-10 16:06 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-08 17:14 [PATCH] Mark prop unused in early_init_dt_scan_chosen() Scott Wood
2007-05-08 23:56 ` Michael Ellerman
2007-05-09 0:41 ` David Gibson
2007-05-10 3:39 ` Kumar Gala
2007-05-10 7:39 ` Geert Uytterhoeven
2007-05-10 15:54 ` Scott Wood
2007-05-10 16:06 ` Geert Uytterhoeven
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).