U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Robert P. J. Day <rpjday@crashcourse.ca>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] Revert "image.h: Tighten up content using handy CONFIG_IS_ENABLED() macro."
Date: Tue, 31 May 2016 08:05:44 -0400 (EDT)	[thread overview]
Message-ID: <alpine.LFD.2.20.1605310759230.9950@localhost.localdomain> (raw)
In-Reply-To: <1464694914-19867-1-git-send-email-yamada.masahiro@socionext.com>

On Tue, 31 May 2016, Masahiro Yamada wrote:

> This reverts commit 56adbb38727320375b2f695bd04600d766d8a1b3.
>
> Since commit 56adbb387273 ("image.h: Tighten up content using handy
> CONFIG_IS_ENABLED() macro."), I found my boards fail to boot Linux
> because the commit changed the logic of macros it touched.  Now,
> IMAGE_ENABLE_RAMDISK_HIGH and IMAGE_BOOT_GET_CMDLINE are 0 for all
> the boards.
>
> As you can see in include/linux/kconfig.h, CONFIG_IS_ENABLE() (and
> IS_ENABLED() as well) can only take a macro that is either defined
> as 1 or undefined.  This is met for boolean options defined in
> Kconfig.  On the other hand, CONFIG_SYS_BOOT_RAMDISK_HIGH and
> CONFIG_SYS_BOOT_GET_CMDLINE are defined without any value in
> arch/*/include/asm/config.h .  This kind of clean-up is welcome,
> but the options should be moved to Kconfig beforehand.

... snip ...

  whoops, that would be my fault, i never considered that possibility,
i thought this was a fairly straightforward (and mostly aesthetic)
change.

  it seems that there is a fair amount of inconsistent usage of CONFIG
settings, as in, if one wants to test only if a setting is defined:

  #ifdef CONFIG_FOO

then it's sufficient to manually set:

  #define CONFIG_FOO

however, in the above, it doesn't hurt to also write:

  #define CONFIG_FOO 1

but the instant you do that, you can *also* then test:

  #if CONFIG_FOO

and i'm wondering how much there is of mixing both tests; that is,
once you write this:

  #define CONFIG_FOO 1

you have a tendency to start using both tests:

  #ifdef CONFIG_FOO
  #if CONFIG_FOO

which is definitely messy. anyway, my fault for not looking at the
above carefully enough before submitting.

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================

  reply	other threads:[~2016-05-31 12:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-31 11:41 [U-Boot] [PATCH] Revert "image.h: Tighten up content using handy CONFIG_IS_ENABLED() macro." Masahiro Yamada
2016-05-31 12:05 ` Robert P. J. Day [this message]
2016-05-31 12:48   ` Masahiro Yamada
2016-06-01  9:17     ` Robert P. J. Day
2016-05-31 14:50 ` Tom Rini

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.20.1605310759230.9950@localhost.localdomain \
    --to=rpjday@crashcourse.ca \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox