lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 12 Sep 2012 08:43:53 +0100
From:	"Jan Beulich" <JBeulich@...e.com>
To:	"Linus Walleij" <linus.walleij@...aro.org>
Cc:	"Grant Likely" <grant.likely@...retlab.ca>,
	<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] allow gpiolib to be a module

>>> On 11.09.12 at 19:38, Linus Walleij <linus.walleij@...aro.org> wrote:
> On Mon, Sep 10, 2012 at 2:16 PM, Jan Beulich <JBeulich@...e.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, ...

> There is a bug too: I don't think this compiles if you compile as
> a module but disable debugfs. Try it out.

... the more to get this one fixed. Will re-submit.

>> +}
>> +module_init(gpiolib_init);
>> +
>> +MODULE_DESCRIPTION("GPIO library");
>> +MODULE_LICENSE("GPL");
> 
> These two things don't really need to be inside an #ifdef
> right?

They don't need to be, but since we need a conditional now
anyway, it seemed reasonable to include these in there too.

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

Powered by Openwall GNU/*/Linux Powered by OpenVZ