All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Simek <monstr@monstr.eu>
To: u-boot@lists.denx.de
Subject: [U-Boot] scripts to sanity-check the Kconfig files
Date: Wed, 4 Jan 2017 16:22:27 +0100	[thread overview]
Message-ID: <f6a535bc-22ab-e01f-aa46-c82f7aac2fa9@monstr.eu> (raw)
In-Reply-To: <alpine.LFD.2.20.1701040906001.13425@ca624034.mitel.com>

On 4.1.2017 15:38, Robert P. J. Day wrote:
> 
>   while i'm in a chatty mood, a few years back, i wrote some simple
> shell scripts that scanned the linux kernel source tree for
> inconsistencies in the Kconfig files, and pointed out things like
> "config" entries that were never used or tested, "select" directives
> that referred to non-existent variables, and so on.
> 
>   i just ran that first script on the current u-boot source, and there
> are quite a number of these. as just partial output, here are some
> Kconfig variables that are (apparently, as long as i didn't screw up
> anything in the script) defined but never used or tested anywhere:
> 
>   ... snip ...
>   >>>>> CMD_MX_CYCLIC
>   cmd/Kconfig:338:config CMD_MX_CYCLIC
>   >>>>> CPU_SPECIFIC_OPTIONS
>   arch/x86/cpu/ivybridge/Kconfig:23:config CPU_SPECIFIC_OPTIONS
>   arch/x86/cpu/broadwell/Kconfig:21:config CPU_SPECIFIC_OPTIONS
>   >>>>> DEBUG_EFI_CONSOLE
>   drivers/serial/Kconfig:115:config DEBUG_EFI_CONSOLE
>   >>>>> DM_MOD_EXP
>   drivers/crypto/rsa_mod_exp/Kconfig:1:config DM_MOD_EXP
>   ... snip ...
> 
> so as to that first example, that shows that the variable
> CMD_MX_CYCLIC is defined in cmd/Kconfig:
> 
>   config CMD_MX_CYCLIC
>         bool "mdc, mwc"
>         help
>           mdc - memory display cyclic
>           mwc - memory write cyclic
> 
> but is never tested for anything, and a grep seems to show that:
> 
> $ grep -r CMD_MX_CYCLIC *
> cmd/Kconfig:config CMD_MX_CYCLIC
> configs/sandbox_noblk_defconfig:CONFIG_CMD_MX_CYCLIC=y
> configs/sandbox_spl_defconfig:CONFIG_CMD_MX_CYCLIC=y
> configs/sandbox_defconfig:CONFIG_CMD_MX_CYCLIC=y
> $
> 
>   OTOH, if you search for just "MX_CYCLIC":
> 
> $ grep -r MX_CYCLIC *A
> cmd/Kconfig:config CMD_MX_CYCLIC
> cmd/mem.c:#ifdef CONFIG_MX_CYCLIC
> cmd/mem.c:#endif /* CONFIG_MX_CYCLIC */
> cmd/mem.c:#ifdef CONFIG_MX_CYCLIC
> cmd/mem.c:#endif /* CONFIG_MX_CYCLIC */
> configs/sandbox_noblk_defconfig:CONFIG_CMD_MX_CYCLIC=y
> configs/sandbox_spl_defconfig:CONFIG_CMD_MX_CYCLIC=y
> configs/sandbox_defconfig:CONFIG_CMD_MX_CYCLIC=y
> include/configs/ea20.h:#define CONFIG_MX_CYCLIC
> include/configs/lwmon5.h:#define CONFIG_MX_CYCLIC        1       /* enable mdc/mwc commands      */
> include/configs/M5249EVB.h:#define CONFIG_MX_CYCLIC	1	/* enable mdc/mwc commands	*/
> include/configs/PMC405DE.h:#define CONFIG_MX_CYCLIC	1	/* enable mdc/mwc commands      */
> include/configs/x600.h:#define CONFIG_MX_CYCLIC		/* enable mdc/mwc commands      */
> include/configs/ipam390.h:#define CONFIG_MX_CYCLIC
> include/configs/da850evm.h:#define CONFIG_MX_CYCLIC
> include/configs/bcm23550_w1d.h:#define CONFIG_MX_CYCLIC
> include/configs/bcm28155_ap.h:#define CONFIG_MX_CYCLIC
> include/configs/omapl138_lcdk.h:#define CONFIG_MX_CYCLIC
> include/configs/bcm_ep_board.h:#define CONFIG_MX_CYCLIC
> include/configs/amcore.h:#define CONFIG_MX_CYCLIC		1 /* enable mdc/mwc commands	*/
> include/configs/digsy_mtc.h:#define CONFIG_MX_CYCLIC	1
> include/configs/amcc-common.h:#define CONFIG_MX_CYCLIC		/* enable mdc/mwc commands      */
> include/configs/xtfpga.h:#define CONFIG_MX_CYCLIC
> include/configs/xilinx-ppc.h:#define CONFIG_MX_CYCLIC		/* enable mdc/mwc commands      */
> include/configs/ti_armv7_keystone2.h:#define CONFIG_MX_CYCLIC
> include/configs/PMC440.h:#define CONFIG_MX_CYCLIC	1	/* enable mdc/mwc commands      */
> include/configs/calimain.h:#define CONFIG_MX_CYCLIC
> include/configs/legoev3.h:#define CONFIG_MX_CYCLIC
> README:- CONFIG_MX_CYCLIC
> scripts/config_whitelist.txt:CONFIG_MX_CYCLIC
> $
> 
>   so it would appear that the *correct* spelling is "CONFIG_MX_CYCLIC"
> as defined in the header file, which is what is being tested in the
> source file cmd/mem.c.

I looked at this. Correct name should be CONFIG_CMD_MX_CYCLIC and for
the rest s/CONFIG_MX_CYCLIC/CONFIG_CMD_MX_CYCLIC/g with move to defconfig.
+ in Kconfig there should be dependecy on CMD_MEMORY.

Thanks,
Michal


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170104/62e6501c/attachment.sig>

  reply	other threads:[~2017-01-04 15:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-04 14:38 [U-Boot] scripts to sanity-check the Kconfig files Robert P. J. Day
2017-01-04 15:22 ` Michal Simek [this message]
2017-01-04 15:38   ` Masahiro Yamada
2017-01-04 16:30   ` Robert P. J. Day
2017-01-04 16:34   ` Robert P. J. Day
2017-01-12 19:32   ` Masahiro Yamada
2017-01-12 23:35     ` Robert P. J. Day

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f6a535bc-22ab-e01f-aa46-c82f7aac2fa9@monstr.eu \
    --to=monstr@monstr.eu \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.