From: Paul Gortmaker <paul.gortmaker@windriver.com>
To: linux-kbuild@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, torvalds@linux-foundation.org,
akpm@linux-foundation.org, davem@davemloft.net,
tony@bakeyournoodle.com, mmarek@suse.cz, lacombar@gmail.com,
Paul Gortmaker <paul.gortmaker@windriver.com>
Subject: [PATCH 0/5] RFC: strip 15,000 lines from a typical autoconf.h
Date: Wed, 11 Apr 2012 19:50:52 -0400 [thread overview]
Message-ID: <1334188257-3449-1-git-send-email-paul.gortmaker@windriver.com> (raw)
Some linux-next builds were showing thousands of repeated warnings like:
linux/netdevice.h:964:1: warning: "__enabled_CONFIG_FCOE" is not defined [-Wundef]
An example is at: http://kisskb.ellerman.id.au/kisskb/buildresult/6091752/
TonyB proposed a fix, and DaveM indicated IS_ENABLED should be fixed
instead. [ https://lkml.org/lkml/2012/3/15/612 ]
This got me looking at IS_ENABLED, and I realized that to support using
this thing in C code, it was bloating our autoconf.h header file by
about 15,000 lines. Ouch. And it still doesn't have all the possible
lines in it, otherwise we'd not see warnings like the above.
If we limit its use to just CPP #if ... directives, we can unwind the
bloat and get down to less than ~1k of lines.
Fortunately IS_ENABLED is fairly new, and of the ~300 instances, only
a handful are actually in C code, so it is easy to unwind those.
The other downside of C users, I thought while unwinding the above users,
is that the use of IS_ENABLED on Kconfig bools in C if (...) conditionals
can give the misleading impression that the two code paths will exist in
the binary, and that the path is chosen at runtime (which it is not).
Commits 1 --> 4 are just largely unwind, so if you are going to just
look at one, please skip to commit #5 and read the commit log there,
as it has more details on how this bloat all came about.
I want to test this more, but I also wanted to get some initial
feedback in case I'm completely barking up the wrong tree here.
Commit ce1744f4ed20ca8 seems to endorse C users of IS_ENABLED, and
it went through Linus and Andrew, so I'm not sure scrapping C users
as a solution will be universally agreeable...
Thanks,
Paul
---
Paul Gortmaker (5):
Revert "mm: replace PAGE_MIGRATION with IS_ENABLED(CONFIG_MIGRATION)"
ARM: remove C users of IS_ENABLED on THUMB2_KERNEL
drivers/net: remove IS_ENABLED usage from wiznet drivers
Revert "kconfig: fix __enabled_ macros definition for invisible and
un-selected symbols"
kconfig: limit IS_ENABLED & similar to CPP usage
arch/arm/include/asm/opcodes.h | 6 ++++
arch/arm/kernel/ftrace.c | 9 +-----
arch/arm/kernel/insn.c | 9 +++---
arch/arm/kernel/kprobes.c | 34 ++++++++++++------------
arch/arm/kernel/patch.c | 28 ++++++++++---------
drivers/net/ethernet/wiznet/w5100.c | 9 ++++--
drivers/net/ethernet/wiznet/w5300.c | 18 ++++++++----
include/linux/kconfig.h | 8 +++---
include/linux/migrate.h | 2 +
mm/mprotect.c | 2 +-
mm/rmap.c | 7 ++---
scripts/kconfig/confdata.c | 49 +++++++++-------------------------
12 files changed, 86 insertions(+), 95 deletions(-)
--
1.7.9.1
next reply other threads:[~2012-04-11 23:52 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-11 23:50 Paul Gortmaker [this message]
2012-04-11 23:50 ` [PATCH 1/5] Revert "mm: replace PAGE_MIGRATION with IS_ENABLED(CONFIG_MIGRATION)" Paul Gortmaker
2012-04-12 0:05 ` Andrew Morton
2012-04-11 23:50 ` [PATCH 2/5] ARM: remove C users of IS_ENABLED on THUMB2_KERNEL Paul Gortmaker
2012-04-11 23:50 ` [PATCH 3/5] drivers/net: remove IS_ENABLED usage from wiznet drivers Paul Gortmaker
2012-04-11 23:54 ` David Miller
2012-04-12 0:06 ` Stephen Rothwell
2012-04-12 0:22 ` Stephen Rothwell
2012-04-12 17:15 ` Paul Gortmaker
2012-04-11 23:50 ` [PATCH 4/5] Revert "kconfig: fix __enabled_ macros definition for invisible and un-selected symbols" Paul Gortmaker
2012-04-11 23:50 ` [PATCH 5/5] kconfig: limit IS_ENABLED & similar to CPP usage Paul Gortmaker
2012-04-12 0:04 ` Linus Torvalds
2012-04-12 17:46 ` Paul Gortmaker
2012-04-11 23:58 ` [PATCH 0/5] RFC: strip 15,000 lines from a typical autoconf.h Linus Torvalds
2012-04-12 1:19 ` Linus Torvalds
2012-04-12 1:45 ` Andrew Morton
2012-04-12 1:55 ` Linus Torvalds
2012-04-12 3:10 ` Stephen Rothwell
2012-04-12 19:29 ` Linus Torvalds
2012-04-12 23:46 ` [PATCH 0/3] RFC v2: " Paul Gortmaker
2012-04-12 23:46 ` [PATCH 1/3] kconfig: fix IS_ENABLED to not require all options to be defined Paul Gortmaker
2012-04-13 10:31 ` Dick Streefland
2012-04-12 23:46 ` [PATCH 2/3] Revert "kconfig: fix __enabled_ macros definition for invisible and un-selected symbols" Paul Gortmaker
2012-04-12 23:46 ` [PATCH 3/3] kconfig: delete last traces of __enabled_ from autoconf.h Paul Gortmaker
2012-04-12 9:27 ` [PATCH 0/5] RFC: strip 15,000 lines from a typical autoconf.h Michal Marek
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=1334188257-3449-1-git-send-email-paul.gortmaker@windriver.com \
--to=paul.gortmaker@windriver.com \
--cc=akpm@linux-foundation.org \
--cc=davem@davemloft.net \
--cc=lacombar@gmail.com \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mmarek@suse.cz \
--cc=tony@bakeyournoodle.com \
--cc=torvalds@linux-foundation.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox