From: Randy Dunlap <rdunlap@xenotime.net>
To: "Robert P. J. Day" <rpjday@crashcourse.ca>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: reasonable for a Kconfig variable to be tested only for "_MODULE"?
Date: Sun, 15 Apr 2012 13:07:58 -0700 [thread overview]
Message-ID: <4F8B2A9E.7060304@xenotime.net> (raw)
In-Reply-To: <alpine.DEB.2.02.1204120725070.17806@oneiric>
On 04/12/2012 04:30 AM, Robert P. J. Day wrote:
>
> playing with my cleanup scripts this morning and ran across this
> output looking for unused CONFIG_ variables under drivers/ata:
>
> $ ../s/find_unused_configs.sh drivers/ata
> ===== PATA_QDI
> drivers/ata/Kconfig:831:config PATA_QDI
> ===== PATA_WINBOND_VLB
> drivers/ata/Kconfig:865:config PATA_WINBOND_VLB
> $
>
> normally, i would flag that as "variables that are defined in a
> Kconfig file but are never tested anywhere", but upon further
> examination:
>
> $ $ grep -r PATA_QDI *
> drivers/ata/Kconfig:config PATA_QDI
> drivers/ata/pata_legacy.c:#ifdef CONFIG_PATA_QDI_MODULE
> $
>
> so "CONFIG_PATA_QDI" isn't tested, but "CONFIG_PATA_QDI_MODULE" *is*,
> which is not something i'd considered. the Kconfig entry:
>
> config PATA_QDI
> tristate "QDI VLB PATA support"
> depends on ISA
> select PATA_LEGACY
> help
> Support for QDI 6500 and 6580 PATA controllers on VESA local bus.
>
> and the relevant source:
>
> /* Set to probe QDI controllers */
> #ifdef CONFIG_PATA_QDI_MODULE
> static int qdi = 1;
> #else
> static int qdi;
> #endif
>
> is that combination reasonable? to test *only* for
> "CONFIG_whatever_MODULE"? if it is, i'll add that check to avoid
> reporting false positives.
Yes, sometimes modules want to behave differently (e.g., initialize
differently) if they are built as a loadable module.
I've seen this other places.
> all of the above can be said for PATA_WINBOND_VLB as well.
>
> rday
>
--
~Randy
prev parent reply other threads:[~2012-04-15 17:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-12 11:30 Robert P. J. Day
2012-04-15 20:07 ` Randy Dunlap [this message]
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=4F8B2A9E.7060304@xenotime.net \
--to=rdunlap@xenotime.net \
--cc=linux-kernel@vger.kernel.org \
--cc=rpjday@crashcourse.ca \
/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
all inboxes | Powered by JetHome®