[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <504EFDAA020000780009A68C@nat28.tlf.novell.com>
Date:	Tue, 11 Sep 2012 08:00:26 +0100
From:	"Jan Beulich" <JBeulich@...e.com>
To:	"Ryan Mallon" <rmallon@...il.com>
Cc:	<linus.walleij@...aro.org>, <grant.likely@...retlab.ca>,
	<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] allow gpiolib to be a module
>>> On 11.09.12 at 08:17, Ryan Mallon <rmallon@...il.com> wrote:
> On 10/09/12 22:16, Jan Beulich wrote:
>> +#ifdef MODULE
>> +int __init gpiolib_init(void)
> 
> Should be static.
Oh, yes, of course.
>> +{
>> +	return gpiolib_sysfs_init() ?: gpiolib_debugfs_init();
> 
> I thought this was going to call gpiolib_sysfs_init() twice until I
> looked at gcc's documentation. Maybe the less obtuse, and far more common:
> 
>   int err;
> 
>   err = gpiolib_sysfs_init();
>   if (err)
>           return err;
> 
>   return gpiolib_debugfs_init();
That construct is being used in many other places throughout
the kernel (including in gpiolib itself), so I don't see why it can't
be used here - the more that it is precisely available to have a
way to avoid the double evaluation.
Jan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
Powered by blists - more mailing lists
 
