lkml.org 
[lkml]   [2012]   [Sep]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] allow gpiolib to be a module
On 09/12/2012 12:43 AM, Jan Beulich wrote:

>>>> On 11.09.12 at 19:38, Linus Walleij <linus.walleij@linaro.org> wrote:
>> On Mon, Sep 10, 2012 at 2:16 PM, Jan Beulich <JBeulich@suse.com> wrote:
>>> +#ifndef MODULE
>>> subsys_initcall(gpiolib_debugfs_init);
>>> +#endif
>>>
>>> #endif /* DEBUG_FS */
>>> +
>>> +#ifdef MODULE
>>> +int __init gpiolib_init(void)
>>> +{
>>> + return gpiolib_sysfs_init() ?: gpiolib_debugfs_init();
>>
>> I can't parse this, sorry the gpio subsystem maintainer is too bad coder.
>> What about something more readable?
>>
>> int ret;
>>
>> ret = gpiolib_sysfs_init();
>> if (ret)
>> return ret;
>> return gpiolib_debugfs_init();
>>
>> I know it doesn't look as cool but it's easier for me to understand.
>
> Okay, since you're the second one to complain despite there
> being other uses of the construct in the same source file, I'll
> replace it, ...


Does C just use the value generated from the left side of a ?:
expression for the middle (empty) expression or does it call the
function again (which would usually be bad)?


--
~Randy


\
 
 \ /
  Last update: 2012-09-12 20:21    [W:0.057 / U:0.184 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site