Re: identifying CONFIG variable typoes in the source tree
On Wed, 24 Jan 2007, Geert Uytterhoeven wrote: > On Tue, 23 Jan 2007, Robert P. J. Day wrote: > > let's check these: > > > > $ grep -r 53C700_BE_BUS . > > ./drivers/scsi/53c700.h:#ifdef CONFIG_53C700_BE_BUS > > This is the core support for big endian 53c700 SCSI busses. It's > needed for various m68k machines, patch to be submitted when the > m68k support is ready for submission. > > Gr{oetje,eeting}s, just to be clear, all that script is doing is identifying variables of the form "CONFIG_fubar" that are being tested in *some* preprocessor directive somewhere in the tree, but for which there is apparently no corresponding entry in a Kconfig file anywhere that could cause that variable to be configured. naturally, as geert suggests, this might represent a feature that's in progress so it's clearly not a mistake. but it's a good way to trap potential problems, as in finding "GALILLEO_GT64240_ETH" which, superficially, would seem like an obvious typo no matter what: $ grep -r GALILLEO_GT64240_ETH . ./arch/mips/momentum/ocelot_g/prom.c:#ifdef CONFIG_GALILLEO_GT64240_ETH ./arch/mips/momentum/ocelot_g/prom.c:#ifdef CONFIG_GALILLEO_GT64240_ETH ./arch/mips/momentum/ocelot_g/setup.c:#ifdef CONFIG_GALILLEO_GT64240_ETH ./arch/mips/momentum/ocelot_g/setup.c:#ifdef CONFIG_GALILLEO_GT64240_ETH $ as well as what is *obviously* dead code: $ grep -rw CONFIG_KERNELD . ./sound/core/timer.c:#ifdef CONFIG_KERNELD $ grep -rw KERNELD . ./net/core/dev.c: * Bjorn Ekwall: Added KERNELD hack. the script isn't perfect -- it will generate false positives if the variable is being set elsewhere -- perhaps hardcoded in the file or defined in a Makefile. but if you're curious, just run it against your favourite subdirectory and see what comes up. rday - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: identifying CONFIG variable typoes in the source tree
On Tue, 23 Jan 2007, Robert P. J. Day wrote: > let's check these: > > $ grep -r 53C700_BE_BUS . > ./drivers/scsi/53c700.h:#ifdef CONFIG_53C700_BE_BUS This is the core support for big endian 53c700 SCSI busses. It's needed for various m68k machines, patch to be submitted when the m68k support is ready for submission. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [EMAIL PROTECTED] In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: identifying CONFIG variable typoes in the source tree
On Tue, 23 Jan 2007, Robert P. J. Day wrote: let's check these: $ grep -r 53C700_BE_BUS . ./drivers/scsi/53c700.h:#ifdef CONFIG_53C700_BE_BUS This is the core support for big endian 53c700 SCSI busses. It's needed for various m68k machines, patch to be submitted when the m68k support is ready for submission. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [EMAIL PROTECTED] In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say programmer or something like that. -- Linus Torvalds - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: identifying CONFIG variable typoes in the source tree
On Wed, 24 Jan 2007, Geert Uytterhoeven wrote: On Tue, 23 Jan 2007, Robert P. J. Day wrote: let's check these: $ grep -r 53C700_BE_BUS . ./drivers/scsi/53c700.h:#ifdef CONFIG_53C700_BE_BUS This is the core support for big endian 53c700 SCSI busses. It's needed for various m68k machines, patch to be submitted when the m68k support is ready for submission. Gr{oetje,eeting}s, just to be clear, all that script is doing is identifying variables of the form CONFIG_fubar that are being tested in *some* preprocessor directive somewhere in the tree, but for which there is apparently no corresponding entry in a Kconfig file anywhere that could cause that variable to be configured. naturally, as geert suggests, this might represent a feature that's in progress so it's clearly not a mistake. but it's a good way to trap potential problems, as in finding GALILLEO_GT64240_ETH which, superficially, would seem like an obvious typo no matter what: $ grep -r GALILLEO_GT64240_ETH . ./arch/mips/momentum/ocelot_g/prom.c:#ifdef CONFIG_GALILLEO_GT64240_ETH ./arch/mips/momentum/ocelot_g/prom.c:#ifdef CONFIG_GALILLEO_GT64240_ETH ./arch/mips/momentum/ocelot_g/setup.c:#ifdef CONFIG_GALILLEO_GT64240_ETH ./arch/mips/momentum/ocelot_g/setup.c:#ifdef CONFIG_GALILLEO_GT64240_ETH $ as well as what is *obviously* dead code: $ grep -rw CONFIG_KERNELD . ./sound/core/timer.c:#ifdef CONFIG_KERNELD $ grep -rw KERNELD . ./net/core/dev.c: * Bjorn Ekwall: Added KERNELD hack. the script isn't perfect -- it will generate false positives if the variable is being set elsewhere -- perhaps hardcoded in the file or defined in a Makefile. but if you're curious, just run it against your favourite subdirectory and see what comes up. rday - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: identifying CONFIG variable typoes in the source tree
On Tue, 23 Jan 2007, Oleg Verych wrote: > On 2007-01-23, Robert P. J. Day wrote: > [] > > what it does is scan the entire tree for lines of the form > > > > ...if... CONFIG_whatever... > > > > collects all of those CONFIG variables and, one at a time, checks to > > see if that variable even exists in any Kconfig file in the tree so > > that it could possibly ever be set. (i'm not guaranteeing that the > > script is perfect, but it does generate some interesting results.) > > > > the first few lines of output: > > > > 53C700_BE_BUS > > 64_BIT > > 68328_SERIAL_UART2 > > ... > > > [] > > the script turns up 284 examples of this. > > Next, this script must to learn how to search whom to send this info. > And if there's nobody, just to make list of known orphans ;). i'm pretty sure that's not going to happen this evening, but i tweaked the script just a bit so you can run it (from the top-level directory) against any subdirectory to see what CONFIG symbols appear to be (for lack of a better word) "orphaned." let's test it against, say, fs/xfs: $ ../config_vars.sh fs/xfs FS_POSIX_CAP FS_POSIX_MAC XFS_DEBUG XFS_DMAPI XFS_TRACE $ grep -r FS_POSIX_CAP . fs/xfs/xfs_cap.h:#ifdef CONFIG_FS_POSIX_CAP $ grep -r FS_POSIX_MAC . ./fs/xfs/xfs_mac.h:#ifdef CONFIG_FS_POSIX_MAC $ grep -r XFS_DEBUG . ./fs/xfs/xfs.h:#ifdef CONFIG_XFS_DEBUG ./fs/xfs/Makefile-linux-2.6:ifeq ($(CONFIG_XFS_DEBUG),y) and so on. of course, there may be good reasons for some of these variables to be there with no corresponding Kconfig entry -- i'm just printing them out. rday p.s. new script is attached. config_vars.sh Description: Bourne shell script
Re: identifying CONFIG variable typoes in the source tree
On 2007-01-23, Robert P. J. Day wrote: [] > what it does is scan the entire tree for lines of the form > > ...if... CONFIG_whatever... > > collects all of those CONFIG variables and, one at a time, checks to > see if that variable even exists in any Kconfig file in the tree so > that it could possibly ever be set. (i'm not guaranteeing that the > script is perfect, but it does generate some interesting results.) > > the first few lines of output: > > 53C700_BE_BUS > 64_BIT > 68328_SERIAL_UART2 > ... > [] > the script turns up 284 examples of this. Next, this script must to learn how to search whom to send this info. And if there's nobody, just to make list of known orphans ;). > rday - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
identifying CONFIG variable typoes in the source tree
because it's cold outside and i was bored, i put together the following script, to be run from the top of the source tree: ==B #!/bin/sh CV=$(grep -rh "^#.*if.* CONFIG_[A-Za-z0-9]" . | grep -v endif) CVARS=$(echo "${CV}" | sed "s/.*\(CONFIG_[^ =\)\*\/]*\).*/\1/" | sort -u | grep "^CONFIG_") kcfiles=$(find . -name "Kconfig*") for cv in ${CVARS} ; do # echo "cv = ${cv}" str=$(echo ${cv} | sed "s/^CONFIG_//") # echo "str = ${str}" grep -wq ${str} ${kcfiles} || echo ${str} done === what it does is scan the entire tree for lines of the form ...if... CONFIG_whatever... collects all of those CONFIG variables and, one at a time, checks to see if that variable even exists in any Kconfig file in the tree so that it could possibly ever be set. (i'm not guaranteeing that the script is perfect, but it does generate some interesting results.) the first few lines of output: 53C700_BE_BUS 64_BIT 68328_SERIAL_UART2 ... let's check these: $ grep -r 53C700_BE_BUS . ./drivers/scsi/53c700.h:#ifdef CONFIG_53C700_BE_BUS in short, a variable that's being tested with no possibility of ever being set in a Kconfig file. moving on, $ grep -rw CONFIG_64_BIT . ./include/asm-um/elf-ppc.h:#ifdef CONFIG_64_BIT $ grep -rw 64_BIT . $ so CONFIG_64_BIT is similarly being tested, but it's not being set anywhere. i'm guessing this is a misspelling of "CONFIG_64BIT", which *does* exist in the tree and is quite common. next: $ grep -r 68328_SERIAL_UART2 . ./drivers/serial/68328serial.h:#ifndef CONFIG_68328_SERIAL_UART2 ./arch/m68knommu/platform/68VZ328/config.c:#ifdef CONFIG_68328_SERIAL_UART2 again, something being tested with no possibility of it being set anywhere. the script turns up 284 examples of this. rday - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
identifying CONFIG variable typoes in the source tree
because it's cold outside and i was bored, i put together the following script, to be run from the top of the source tree: ==B #!/bin/sh CV=$(grep -rh ^#.*if.* CONFIG_[A-Za-z0-9] . | grep -v endif) CVARS=$(echo ${CV} | sed s/.*\(CONFIG_[^ =\)\*\/]*\).*/\1/ | sort -u | grep ^CONFIG_) kcfiles=$(find . -name Kconfig*) for cv in ${CVARS} ; do # echo cv = ${cv} str=$(echo ${cv} | sed s/^CONFIG_//) # echo str = ${str} grep -wq ${str} ${kcfiles} || echo ${str} done === what it does is scan the entire tree for lines of the form ...if... CONFIG_whatever... collects all of those CONFIG variables and, one at a time, checks to see if that variable even exists in any Kconfig file in the tree so that it could possibly ever be set. (i'm not guaranteeing that the script is perfect, but it does generate some interesting results.) the first few lines of output: 53C700_BE_BUS 64_BIT 68328_SERIAL_UART2 ... let's check these: $ grep -r 53C700_BE_BUS . ./drivers/scsi/53c700.h:#ifdef CONFIG_53C700_BE_BUS in short, a variable that's being tested with no possibility of ever being set in a Kconfig file. moving on, $ grep -rw CONFIG_64_BIT . ./include/asm-um/elf-ppc.h:#ifdef CONFIG_64_BIT $ grep -rw 64_BIT . $ so CONFIG_64_BIT is similarly being tested, but it's not being set anywhere. i'm guessing this is a misspelling of CONFIG_64BIT, which *does* exist in the tree and is quite common. next: $ grep -r 68328_SERIAL_UART2 . ./drivers/serial/68328serial.h:#ifndef CONFIG_68328_SERIAL_UART2 ./arch/m68knommu/platform/68VZ328/config.c:#ifdef CONFIG_68328_SERIAL_UART2 again, something being tested with no possibility of it being set anywhere. the script turns up 284 examples of this. rday - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: identifying CONFIG variable typoes in the source tree
On 2007-01-23, Robert P. J. Day wrote: [] what it does is scan the entire tree for lines of the form ...if... CONFIG_whatever... collects all of those CONFIG variables and, one at a time, checks to see if that variable even exists in any Kconfig file in the tree so that it could possibly ever be set. (i'm not guaranteeing that the script is perfect, but it does generate some interesting results.) the first few lines of output: 53C700_BE_BUS 64_BIT 68328_SERIAL_UART2 ... [] the script turns up 284 examples of this. Next, this script must to learn how to search whom to send this info. And if there's nobody, just to make list of known orphans ;). rday - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: identifying CONFIG variable typoes in the source tree
On Tue, 23 Jan 2007, Oleg Verych wrote: On 2007-01-23, Robert P. J. Day wrote: [] what it does is scan the entire tree for lines of the form ...if... CONFIG_whatever... collects all of those CONFIG variables and, one at a time, checks to see if that variable even exists in any Kconfig file in the tree so that it could possibly ever be set. (i'm not guaranteeing that the script is perfect, but it does generate some interesting results.) the first few lines of output: 53C700_BE_BUS 64_BIT 68328_SERIAL_UART2 ... [] the script turns up 284 examples of this. Next, this script must to learn how to search whom to send this info. And if there's nobody, just to make list of known orphans ;). i'm pretty sure that's not going to happen this evening, but i tweaked the script just a bit so you can run it (from the top-level directory) against any subdirectory to see what CONFIG symbols appear to be (for lack of a better word) orphaned. let's test it against, say, fs/xfs: $ ../config_vars.sh fs/xfs FS_POSIX_CAP FS_POSIX_MAC XFS_DEBUG XFS_DMAPI XFS_TRACE $ grep -r FS_POSIX_CAP . fs/xfs/xfs_cap.h:#ifdef CONFIG_FS_POSIX_CAP $ grep -r FS_POSIX_MAC . ./fs/xfs/xfs_mac.h:#ifdef CONFIG_FS_POSIX_MAC $ grep -r XFS_DEBUG . ./fs/xfs/xfs.h:#ifdef CONFIG_XFS_DEBUG ./fs/xfs/Makefile-linux-2.6:ifeq ($(CONFIG_XFS_DEBUG),y) and so on. of course, there may be good reasons for some of these variables to be there with no corresponding Kconfig entry -- i'm just printing them out. rday p.s. new script is attached. config_vars.sh Description: Bourne shell script