finding macro names that might need a "CONFIG_" prefix

From: Robert P. J. Day
Date: Fri Feb 02 2007 - 04:24:31 EST



as another test, i wrote the following script:

http://www.fsdev.dreamhosters.com/wiki/index.php?title=Misspelled_CONFIG_variables

that scans whatever part of the kernel source tree you want, and
locates macro names in preprocessor conditionals that might be
erroneously missing a "CONFIG_" prefix.

as an example (and for no particular reason), let's pick on the
reiser file system:

$ bad_config.sh fs/reiserfs/
========== REISERFS_PROC_INFO ==========
fs/reiserfs/procfs.c:#if defined( REISERFS_PROC_INFO )
fs/reiserfs/procfs.c:/* REISERFS_PROC_INFO */
fs/reiserfs/procfs.c:/* REISERFS_PROC_INFO */
./fs/Kconfig:config REISERFS_PROC_INFO

that looks pretty clearly like someone should be testing
"CONFIG_REISERFS_PROC_INFO" rather than just "REISERFS_PROC_INFO", no?

what about NTFS?

$ bad_config.sh fs/ntfs
========== NTFS_DEBUG ==========
fs/ntfs/attrib.c:#ifdef NTFS_DEBUG <--- aha!
./fs/Kconfig:config NTFS_DEBUG
========== NTFS_RW ==========
fs/ntfs/logfile.h:#ifdef NTFS_RW <--- another potential aha
fs/ntfs/logfile.h:#endif /* NTFS_RW */
... lots of dups removed ...
./fs/Kconfig:config NTFS_RW

anyway, you get the idea. have at it.

rday

--
========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA

http://www.fsdev.dreamhosters.com/wiki/index.php?title=Main_Page
========================================================================
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/