mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: "Robert P. J. Day" <rpjday@crashcourse.ca>
To: "U-Boot Version 2 (barebox)" <barebox@lists.infradead.org>
Subject: the "CONFIG_" namespace and what's with "CFG_CMD_" prefixes?
Date: Sun, 20 Dec 2009 09:06:07 -0500 (EST)	[thread overview]
Message-ID: <alpine.LFD.2.00.0912200859330.20718@localhost> (raw)


  based on some scanning i just did, i notice the following
occurrences of the "CMD_CFG_" prefix on a number of preprocessor
variables:

$ grep -r CFG_CMD *
arch/ppc/mach-mpc5xxx/interrupts.c:#if (CONFIG_COMMANDS & CFG_CMD_IRQ)
arch/ppc/mach-mpc5xxx/ide.c:#ifdef CFG_CMD_IDE
arch/ppc/mach-mpc5xxx/ide.c:#endif /* CFG_CMD_IDE */
arch/ppc/lib/kgdb.c:#endif /* CFG_CMD_KGDB */
board/pcm030/pcm030.c:#if defined (CFG_CMD_IDE) && defined (CONFIG_IDE_RESET)
board/pcm030/pcm030.c:#endif /* defined (CFG_CMD_IDE) && defined (CONFIG_IDE_RESET) */
commands/loads.c:# if (CONFIG_COMMANDS & CFG_CMD_SAVES)
commands/loads.c:# endif /* CFG_CMD_SAVES */
commands/loads.c:#if (CONFIG_COMMANDS & CFG_CMD_SAVES)
commands/loads.c:# endif /* CFG_CMD_SAVES */
commands/loads.c:#if (CONFIG_COMMANDS & CFG_CMD_SAVES)
commands/loads.c:#endif	/* CFG_CMD_SAVES */
common/Kconfig:	  automatically enabled when you select CFG_CMD_DATE .
drivers/net/at91_ether.c:#if defined(CONFIG_MII) || (CONFIG_COMMANDS & CFG_CMD_MII)
drivers/net/at91_ether.c:#endif	/* defined(CONFIG_MII) || (CONFIG_COMMANDS & CFG_CMD_MII) */
drivers/net/at91_ether.c:#if defined(CONFIG_MII) || (CONFIG_COMMANDS & CFG_CMD_MII)
lib/crc32.c:#include <common.h>	/* to get command definitions like CFG_CMD_JFFS2 */
$

  it's not clear what that prefix is supposed to represent since, in
at least one case, it might be a typo -- "CMD_SAVES":

$ grep -r CMD_SAVES *
commands/loads.c:# if (CONFIG_COMMANDS & CFG_CMD_SAVES)
commands/loads.c:# endif /* CFG_CMD_SAVES */
commands/loads.c:#if (CONFIG_COMMANDS & CFG_CMD_SAVES)
commands/loads.c:# endif /* CFG_CMD_SAVES */
commands/loads.c:#if (CONFIG_COMMANDS & CFG_CMD_SAVES)
commands/loads.c:#endif	/* CFG_CMD_SAVES */
commands/Kconfig:config CMD_SAVES
$

  if those tests are meant to match that Kconfig variable, then
obviously they're misspelled.  if not, then i'm not sure what's going
on.  where *are* CFG_CMD_ variables supposed to be defined?  as in:

$ grep -rw CFG_CMD_MII *
drivers/net/at91_ether.c:#if defined(CONFIG_MII) || (CONFIG_COMMANDS & CFG_CMD_MII)
drivers/net/at91_ether.c:#endif	/* defined(CONFIG_MII) || (CONFIG_COMMANDS & CFG_CMD_MII) */
drivers/net/at91_ether.c:#if defined(CONFIG_MII) || (CONFIG_COMMANDS & CFG_CMD_MII)
$

  as a final point, it's standard practise that the "CONFIG_"-prefixed
variable namespace should be reserved *exclusively* for Kconfig
variables.  at least that's the way it works in the kernel world.

  thoughts?

rday
--


========================================================================
Robert P. J. Day                               Waterloo, Ontario, CANADA

            Linux Consulting, Training and Kernel Pedantry.

Web page:                                          http://crashcourse.ca
Twitter:                                       http://twitter.com/rpjday
========================================================================

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

             reply	other threads:[~2009-12-20 14:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-20 14:06 Robert P. J. Day [this message]
2009-12-21 10:01 ` Sascha Hauer

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=alpine.LFD.2.00.0912200859330.20718@localhost \
    --to=rpjday@crashcourse.ca \
    --cc=barebox@lists.infradead.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox