lkml.org 
[lkml]   [2012]   [Sep]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] allow gpiolib to be a module
>>> On 11.09.12 at 08:17, Ryan Mallon <rmallon@gmail.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



\
 
 \ /
  Last update: 2012-09-11 09:41    [W:0.044 / U:0.140 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site