summaryrefslogtreecommitdiffstats
path: root/scripts/checkkconfigsymbols.sh
Commit message (Collapse)AuthorAgeFilesLines
* checkkconfigsymbols.sh: reimplementation in pythonValentin Rothberg2014-11-071-59/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The scripts/checkkconfigsymbols.sh script searches Kconfig features in the source code that are not defined in Kconfig. Such identifiers always evaluate to false and are the source of various kinds of bugs. However, the shell script is slow and it does not detect such broken references in Kbuild and Kconfig files (e.g., ``depends on UNDEFINED´´). Furthermore, it generates false positives. The script is also hard to read and understand, and is thereby difficult to maintain. This patch replaces the shell script with an implementation in Python, which: (a) detects the same bugs, but does not report previous false positives (b) additionally detects broken references in Kconfig and all non-Kconfig files, such as Kbuild, .[cSh], .txt, .sh, defconfig, etc. (c) is up to 75 times faster than the shell script (d) only checks files under version control The new script reduces the runtime on my machine (i7-2620M, 8GB RAM, SSD) from 3m47s to 0m3s, and reports 938 broken references in Linux v3.17-rc1; 419 additional reports of which 16 are located in Kconfig files, 287 in defconfigs, 63 in ./Documentation, 1 in Kbuild. Moreover, we intentionally include references in comments, which have been ignored until now. Such comments may be leftovers of features that have been removed or renamed in Kconfig (e.g., ``#endif /* CONFIG_MPC52xx */´´). These references can be misleading and should be removed or replaced. Note that the output format changed from (file list <tab> feature) to (feature <tab> file list) as it simplifies the detection of the Kconfig feature for long file lists. Signed-off-by: Valentin Rothberg <valentinrothberg@gmail.com> Signed-off-by: Stefan Hengelein <stefan.hengelein@fau.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* scripts/checkkconfigsymbols.sh: replace echo -e with printfMax Filippov2013-08-281-2/+2
| | | | | | | | | -e is a non-standard echo option, echo output is implementation-dependent when it is used. Replace echo -e with printf as suggested by POSIX echo manual. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
* checkkconfigsymbols.sh: Kconfig symbols sometimes have lowercase lettersRoland Dreier2010-06-031-1/+1
| | | | | | | | | | | | | | | | Quite a few Kconfig symbols contain lowercase letters. The current checkkconfigsymbols.sh code only contains A-Z in the regexp it uses to find config symbols in source code, so it comes up with the wrong symbol to look for in Kconfig files and then generates false positives when it doesn't find that wrong symbol. For example checking drivers/net generates a false positive for MAC89 because the the actual config option is MAC89x0. Fix this by also adding a-z to the regexp. Signed-off-by: Roland Dreier <rolandd@cisco.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Michal Marek <mmarek@suse.cz>
* kbuild,scripts: use non-builtin echo for '-e'Amerigo Wang2009-10-111-2/+2
| | | | | | | | | Alek reported that on Ubuntu, where dash is used, 'echo -e' can't work, so let's use non-builtin echo in this case. Reported-by: Alek Du <alek.du@intel.com> Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
* kbuild: script to check for undefined Kconfig symbolsPaolo 'Blaisorblade' Giarrusso2007-10-121-0/+59
To avoid having to look manually for used but undefined Kconfig variables, I've written a script which tries do this efficiently, in case all other attention fail. It accounts for _MODULE suffix and for UML_ prefixes to Kconfig variable, but otherwise looks for exact matches (i.e. \<CONFIG_; this is done to exclude macros like MMCONFIG_). Undefined Kconfig variables should be not be removed without care, but for instance arch/i386/boot/ uses a bunch of undefined Kconfig vars: $ scripts/checkunknowndefines.sh arch/i386/boot/ arch/i386/boot/video.h uses undefined symbol VIDEO_400_HACK arch/i386/boot/video-vga.c uses undefined symbol VIDEO_400_HACK arch/i386/boot/video.c uses undefined symbol VIDEO_RETAIN arch/i386/boot/video.h uses undefined symbol VIDEO_RETAIN arch/i386/boot/video.h uses undefined symbol VIDEO_SVGA arch/i386/boot/video.h uses undefined symbol VIDEO_VESA arch/i386/boot/video-vesa.c uses undefined symbol VIDEO_VESA It should also be mentioned in SubmittingPatches and SubmitChecklist. Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Cc: Roman Zippel <zippel@linux-m68k.org> Cc: Adrian Bunk <bunk@stusta.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>