lkml.org 
[lkml]   [2011]   [May]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v2] kconfig: autogenerated config_is_xxx macro
From
On Fri, May 13, 2011 at 1:01 PM, Ingo Molnar <mingo@elte.hu> wrote:
>
> * Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> wrote:
>
>> On 10:30 Fri 13 May     , Ingo Molnar wrote:
>> >
>> > * Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> wrote:
>> >
>> > > -#ifdef CONFIG_PCI_BIOS
>> > > - if (!rt->signature) {
>> > > + if (config_is_pci_bios() && !rt->signature) {
>> >
>> > Makes sense - but please name it in a more obvious way, such as:
>> >
>> >     pci_bios_enabled()
>> the idea to generate the macro via Kconfig
>
> Okay, and there we are stuck with whatever the Kconfig name is. (we could
> rename that but not needed really)
>
> Why not the canonical config_pci_bios() variant? It's the shortest one to
> write. The '_is' looks pretty superfluous to me.
>
> Hm, i guess it could be mixed up with a function that configures the pci_bios.
>
> I guess since i don't have any better idea config_is_pci_bios() sounds like a
> good choice after all.

But we don't name config options like CONFIG_IS_PCI_BIOS, do we?
One should lowercase config option to minimize confusion, nothing more
if lowercased variant is OK.

Why it looks like a function call?

In fact one can even do

if (CONFIG_PCI_BIOS && !rt->signature) {

for boolean options.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2011-05-13 12:23    [W:0.099 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site