This is an old revision of the document!
Overview
The result of running my find_badref_configs.sh script, which looks for CONFIG_* variables being tested, but apparently not defined in any Kconfig* file.
find_badref_configs.sh
#!/bin/sh
SCAN_DIR=${1-*}
CVARS=$(find ${SCAN_DIR} -name "*.[ch]" | \
grep -v "mach-types.h" | \
xargs ifnames | \
grep "^CONFIG_" | \
cut -d' ' -f1 | \
sed "s/^CONFIG_//" | \
sed "s/_MODULE$//" | \
sort -u)
ALL_KCONFIG_FILES=$(find . -name "Kconfig*")
#
# Scan the entire tree, just to see what turns up.
#
for cv in ${CVARS} ; do
# echo "Testing ${cv} ..."
egrep -q "^[[:space:]]*config[[:space:]]+${cv}\b" ${ALL_KCONFIG_FILES} ||
grep -q "^menuconfig *${cv}$" ${ALL_KCONFIG_FILES} ||
egrep -qr "^[[:space:]]*#[[:space:]]*define[[:space:]]+CONFIG_${cv}\b" * || {
echo ">>>>> ${cv}"
grep -rwn "CONFIG_${cv}" * | grep -v defconfig
grep -rwn "${cv}" * | grep -v defconfig
}
done 2> /dev/null