All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Marek <mmarek@suse.cz>
To: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Arnaud Lacombe <lacombar@gmail.com>,
	linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org
Subject: Re: [PATCH v2] kconfig: autogenerated config_is_xxx macro
Date: Mon, 09 May 2011 10:52:39 +0200	[thread overview]
Message-ID: <4DC7AB57.9050002@suse.cz> (raw)
In-Reply-To: <20110507015041.GA21017@game.jcrosoft.org>

On 7.5.2011 03:50, Jean-Christophe PLAGNIOL-VILLARD wrote:
> On 12:19 Fri 06 May     , Arnaud Lacombe wrote:
>> Why would it be a good thing ?
>>
>> Most configuration-dependent code inside functions tends to be moved
>> to a static inline already, which get conditionally defined based on
>> the CONFIG_<foo>. If it is not, then the code is badly architectured
>> (->  bad). Using that if(xxx) notation would also lead to yet more
>> heavily indented function (->  bad). Moreover, this introduces
>> yet-another way to check for an information (->  bad), and you will end
>> up with mixing the config_is_<xxx>  notation inside a function
>> declaration, and CONFIG_<xxx>  when not inside a function (->  bad)
>>
>> Actually, this is even worse than that as you'll not be able to hide
>> structure (or structure members) inside CONFIG_<xxx>  and use that
>> structure (or structure members) in config_is_<xxx>  protected block
>> without causing compile-time failure.
> sorry but conditionnal structure members is bad practice
> you save nearly no space nut for the test of the code in multiple
> configuration. Use union for this.
>
> the compile-time failure is good here. it's means your code is not generic.
>
> specially when you want to keep code running on multiple soc/arch keep compiling
> no matter the configuration
>
> #ifdef in the code is a really bad habit

Do you have proof of concept patches that make use of the config_is_xxx 
macros? Acked by the respective subsystem maintainers? It would be a 
good idea to send them along to show that this feature is going to be 
actually used.

Michal

  reply	other threads:[~2011-05-09  8:52 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-06  5:03 [PATCH v2] kconfig: autogenerated config_is_xxx macro Jean-Christophe PLAGNIOL-VILLARD
2011-05-06 16:19 ` Arnaud Lacombe
2011-05-07  1:50   ` Jean-Christophe PLAGNIOL-VILLARD
2011-05-09  8:52     ` Michal Marek [this message]
2011-05-13  8:09       ` Jean-Christophe PLAGNIOL-VILLARD
2011-05-13  8:30         ` Ingo Molnar
2011-05-13  8:36           ` Jean-Christophe PLAGNIOL-VILLARD
2011-05-13 10:01             ` Ingo Molnar
2011-05-13 10:21               ` Alexey Dobriyan
2011-05-13 10:38                 ` Michal Marek
2011-05-13 12:21                 ` Ingo Molnar
2011-05-14 10:02                   ` Jean-Christophe PLAGNIOL-VILLARD
2011-05-13 15:19         ` Arnaud Lacombe
2011-05-16 19:03         ` Valdis.Kletnieks
2011-05-16 19:38           ` Arnaud Lacombe
2011-05-16 20:05             ` Michal Marek
2011-05-16 20:24               ` Arnaud Lacombe
2011-05-16 20:33                 ` Michal Marek
2011-05-17  1:08                   ` Jean-Christophe PLAGNIOL-VILLARD
2011-05-17  1:03             ` Jean-Christophe PLAGNIOL-VILLARD
2011-05-17 19:13               ` Valdis.Kletnieks
2011-05-18  5:27                 ` Jean-Christophe PLAGNIOL-VILLARD
2011-05-13 16:26 ` Andi Kleen
2011-05-13 18:18 ` Arnaud Lacombe
2011-05-17 14:45 ` Michal Marek
2011-05-17 18:19   ` Jean-Christophe PLAGNIOL-VILLARD

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4DC7AB57.9050002@suse.cz \
    --to=mmarek@suse.cz \
    --cc=lacombar@gmail.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=plagnioj@jcrosoft.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.