All of lore.kernel.org
 help / color / mirror / Atom feed
From: Domen Puncer <domen@coderock.org>
To: kernel-janitors@vger.kernel.org
Subject: [Kernel-janitors] [rfc] a lot of unused CONFIG_*
Date: Sat, 17 Jan 2004 16:04:40 +0000	[thread overview]
Message-ID: <200401171704.40353.domen@coderock.org> (raw)

Hi.

# wc -l CONFIG_defined_but_not_used CONFIG_not_defined_but_used
    116 CONFIG_defined_but_not_used
    635 CONFIG_not_defined_but_used

This is a lot!

I didn't strip out "*_MODULE" (don't know if they're automagicaly
generated and it doesn't make much difference).

So... am I wrong about my script, or do we have A LOT of work to do?

Any suggestions, how to fix this? (grepping for every symbol, and
replacing it takes too much time).


Upper 2 files were generated from following commands in bash.
Sorry, not very readable, i know.
# these executed on kernel source
# find files that use *CONFIG_*
find | egrep '\.[chS]$' | xargs egrep 'CONFIG_[A-Z0-9a-z]*' | sed 's/.*CONFIG_/CONFIG_/g' | sed 's/[^A-Z0-9a-z_].*//' | sort | uniq | tee ../CONFIGs_in_source

# find CONFIG_* that are defined in Kconfig files
find | grep Kconfig | xargs egrep '^config.*[A-Z0-9a-z_]+$' | sed 's/.*config[^A-Z0-9a-z_]*/CONFIG_/g' | sort | uniq | tee ../config

# find *CONFIG_* defined in sources
find | egrep '\.[chS]$' | xargs egrep '#define.*CONFIG' | sed 's/.*CONFIG_/CONFIG_/g' | sed 's/[^A-Z0-9a-z_].*//' | sort | uniq | tee ../CONFIGs_defined

# these on ".." relative to kernel source
# used (or defined) in sources, but not defined in Kconfig
diff CONFIGs_in_source config | egrep '^<' | cut -f2 -d\  > CONFIGs_not_in_config

# filename says it all
diff CONFIGs_not_in_config CONFIGs_defined | grep '<' | cut -f2 -d\  > CONFIG_not_defined_but_used

# see filename
diff CONFIGs_not_in_config CONFIGs_defined | grep '>' | cut -f2 -d\  > CONFIG_defined_but_not_used

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors

             reply	other threads:[~2004-01-17 16:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-17 16:04 Domen Puncer [this message]
2004-01-18 12:53 ` [Kernel-janitors] [rfc] a lot of unused CONFIG_* Adrian Bunk
2004-01-19 18:22 ` Randy.Dunlap

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=200401171704.40353.domen@coderock.org \
    --to=domen@coderock.org \
    --cc=kernel-janitors@vger.kernel.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 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.