[KJ] [RFC] request_region() error handling fixes

Badari Pulavarty pbadari at us.ibm.com
Wed Sep 27 14:04:25 PDT 2006


On Wed, 2006-09-27 at 13:48 -0700, Nishanth Aravamudan wrote:
> On 27.09.2006 [12:59:54 -0700], Badari Pulavarty wrote:
> > Hi,
> > 
> > I started working on request_region() error handling fixes.
> > Before I got too far, want to make sure its following approach
> > is acceptable. (not happy with too many "goto" statements). 
> > Is there a better way to do this ?
> 
> I don't think there is any better way to do multiple stacked failures
> than many gotos. At least, if the goal is to avoid code duplication
> (which I would say it is).

Okay. Do you think I should add unlikely() for these to get better
code ?

> > Please comment.
> 
> Looks good, except one nit and one error below.
> 
> <snip>
> 
> > ===================================================================
> > --- linux-2.6.18.orig/arch/powerpc/platforms/chrp/setup.c	2006-09-27 09:17:23.000000000 -0700
> > +++ linux-2.6.18/arch/powerpc/platforms/chrp/setup.c	2006-09-27 13:20:17.000000000 -0700
> 
> <snip>
> 
> > +	if (!request_region(0x20,0x20,"pic1")) {
> > +		printk(KERN_WARNING"chrp_init: pic1 request region failed\n");
> 
> nit: usually a space is placed between the KERN_ and the string to be
> output. Same goes for all the printk()s added.

Sure. Will do. I copied it from another place :(

> 
> <snip>
> 
> > Index: linux-2.6.18/arch/ppc/platforms/pplus.c
> > ===================================================================
> > --- linux-2.6.18.orig/arch/ppc/platforms/pplus.c	2006-09-19 20:42:06.000000000 -0700
> > +++ linux-2.6.18/arch/ppc/platforms/pplus.c	2006-09-27 10:02:48.000000000 -0700
> > @@ -814,14 +814,49 @@
> >  static void __init pplus_init2(void)
> >  {
> >  #ifdef CONFIG_NVRAM
> > -	request_region(PREP_NVRAM_AS0, 0x8, "nvram");
> > +	if (request_region(PREP_NVRAM_AS0, 0x8, "nvram")) {
> 
> This should be a negated test like all the rest, right?

Yes. My fault.

Thanks,
Badari




More information about the Kernel-janitors mailing list