[U-Boot] Kconfig cleanup -- identifying CONFIG variables not defined in any Kconfig file
Robert P. J. Day
rpjday at crashcourse.ca
Wed Jan 4 19:11:44 CET 2017
as a followup to my earlier post, one of my other linux kernel
cleanup scripts was to identify "CONFIG_*" variables that *were*
being tested in the source somewhere, but for which there was no
definition for that variable in any Kconfig file.
for example, if there exists a line:
#if defined(CONFIG_RDAY)
then one should expect some Kconfig file to contain the definition:
config RDAY
... blah blah ...
sadly, that doesn't work so well with u-boot given the plethora of
CONFIG_* variables that are simply hard-coded in header files, rather
than being defined in any Kconfig file.
still, there seems to be a ton of that stuff; for example:
$ grep -r CONFIG_I2CFAST *
common/board_r.c:#if defined(CONFIG_I2CFAST)
common/board_r.c:#endif /* CONFIG_I2CFAST */
README: CONFIG_I2CFAST (PPC405GP|PPC405EP only)
scripts/config_whitelist.txt:CONFIG_I2CFAST
$
so there we have a CONFIG variable that is clearly being tested, but
does not seem to be defined *anywhere*, even hard-coded in a header
file. however, since it exists, it ends up in the whitelist file.
another short example:
$ grep -r MTD_UBI_BLOCK *
drivers/mtd/ubi/ubi.h:#ifdef CONFIG_MTD_UBI_BLOCK
include/ubi_uboot.h:#undef CONFIG_MTD_UBI_BLOCK
scripts/config_whitelist.txt:CONFIG_MTD_UBI_BLOCK
$
anyway, there's plenty of that sort of thing scattered through the
code base.
rday
--
========================================================================
Robert P. J. Day Ottawa, Ontario, CANADA
http://crashcourse.ca
Twitter: http://twitter.com/rpjday
LinkedIn: http://ca.linkedin.com/in/rpjday
========================================================================
More information about the U-Boot
mailing list