linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Michael Ellerman <michael@ellerman.id.au>
To: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Cc: linuxppc-dev@ozlabs.org, Paul Mackerras <paulus@samba.org>
Subject: Re: [PATCH] Split initrd logic out of early_init_dt_scan_chosen() to fix warning
Date: Thu, 10 May 2007 17:57:48 +1000	[thread overview]
Message-ID: <1178783868.3696.22.camel@concordia.ozlabs.ibm.com> (raw)
In-Reply-To: <Pine.LNX.4.62.0705100947460.32241@pademelon.sonytel.be>

[-- Attachment #1: Type: text/plain, Size: 1526 bytes --]

On Thu, 2007-05-10 at 09:48 +0200, Geert Uytterhoeven wrote:
> On Thu, 10 May 2007, Michael Ellerman wrote:
> > If CONFIG_BLK_DEV_INITRD is not defined the prop variable in
> > early_init_dt_scan_chosen() is unused, causing a compiler warning.
> > 
> > So split the initrd logic into a separate function, allowing us to
> > declare prop only when we need it.
> > 
> > Built for both cases and booted with an initrd.
> > 
> > Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
> > ---
> > 
> >  arch/powerpc/kernel/prom.c |   48 ++++++++++++++++++++++++++++++---------------
> >  1 file changed, 32 insertions(+), 16 deletions(-)
> > 
> > Index: powerpc/arch/powerpc/kernel/prom.c
> > ===================================================================
> > --- powerpc.orig/arch/powerpc/kernel/prom.c
> > +++ powerpc/arch/powerpc/kernel/prom.c
> > @@ -716,11 +716,41 @@ static int __init early_init_dt_scan_cpu
> >  	return 0;
> >  }
> >  
> > +#ifdef CONFIG_BLK_DEV_INITRD
> 
> > +#else
> > +static inline void early_init_dt_check_for_initrd(unsigned long node)
> > +{
> > +	return;
> > +}
> > +#endif /* CONFIG_BLK_DEV_INITRD */
> 
> There's no need to use `return' in functions returning void.

I think it looks nicer :)

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 --]

      reply	other threads:[~2007-05-10  7:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-10  7:06 [PATCH] Split initrd logic out of early_init_dt_scan_chosen() to fix warning Michael Ellerman
2007-05-10  7:48 ` Geert Uytterhoeven
2007-05-10  7:57   ` Michael Ellerman [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1178783868.3696.22.camel@concordia.ozlabs.ibm.com \
    --to=michael@ellerman.id.au \
    --cc=Geert.Uytterhoeven@sonycom.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).