All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heiko Schocher <hs@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/5] tools: fix define2mk.sed to not add quotes around negative integers
Date: Mon, 13 Jun 2016 06:47:22 +0200	[thread overview]
Message-ID: <575E3ADA.2040109@denx.de> (raw)
In-Reply-To: <1465572021-13692-4-git-send-email-yamada.masahiro@socionext.com>

Hello Masahiro,

Am 10.06.2016 um 17:20 schrieb Masahiro Yamada:
> The sed script, tools/scripts/define2mk.sed, converts config defines
> from C headers into include/autoconf.mk for the use in Makefiles.
>
> I found the tool adds quotes around negative integer values.
>
> For example, at the point of the v2016.07-rc1 tag,
> include/configs/microblaze-generic.h defines
>    #define CONFIG_BOOTDELAY         -1     /* -1 disables auto-boot */
>
> Because it is an integer option, it should be converted to:
>    CONFIG_BOOTDELAY=-1
>
> But, the script actually converts it to:
>    CONFIG_BOOTDELAY="-1"
>
> This is a fatal problem for the tools/moveconfig.py because it parses
> include/autoconf.mk for the config defines from the board headers.
> CONFIG_BOOTDELAY="-1" is considered as a string type option and it
> is dropped due to the type mismatch from the entry in Kconfig.
>
> Before commit bb597c0eeb7e ("common: bootdelay: move CONFIG_BOOTDELAY
> into a Kconfig option"), several boards defined CONFIG_BOOTDELAY as -1
> but they are all gone now.
>
> I will fix the mis-converted options right away, but first I need to
> fix the script so that tools/moveconfig.py can convert integer config
> options with a negative value correctly.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
>
>   tools/scripts/define2mk.sed | 2 ++
>   1 file changed, 2 insertions(+)

Uff.. many thanks for the fix!

Reviewed-by: Heiko Schocher <hs@denx.de>

bye,
Heiko
>
> diff --git a/tools/scripts/define2mk.sed b/tools/scripts/define2mk.sed
> index c641edf..0f00285 100644
> --- a/tools/scripts/define2mk.sed
> +++ b/tools/scripts/define2mk.sed
> @@ -22,6 +22,8 @@
>   	s/=\(..*\)/="\1"/;
>   	# but remove again from decimal numbers
>   	s/="\([0-9][0-9]*\)"/=\1/;
> +	# ... and from negative decimal numbers
> +	s/="\(-[1-9][0-9]*\)"/=\1/;
>   	# ... and from hex numbers
>   	s/="\(0[Xx][0-9a-fA-F][0-9a-fA-F]*\)"/=\1/;
>   	# ... and from configs defined from other configs
>

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

  reply	other threads:[~2016-06-13  4:47 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-10 15:20 [U-Boot] [PATCH 0/5] Urgent fixes for misconverted CONFIG_BOOTDELAY Masahiro Yamada
2016-06-10 15:20 ` [U-Boot] [PATCH 1/5] ARM: stm32: remove unused CONFIG_AUTOBOOT Masahiro Yamada
2016-06-10 15:20 ` [U-Boot] [PATCH 2/5] autoboot: follow-up cleanup after CONFIG_BOOTDELAY moves Masahiro Yamada
2016-06-13  4:45   ` Heiko Schocher
2016-06-10 15:20 ` [U-Boot] [PATCH 3/5] tools: fix define2mk.sed to not add quotes around negative integers Masahiro Yamada
2016-06-13  4:47   ` Heiko Schocher [this message]
2016-06-10 15:20 ` [U-Boot] [PATCH 4/5] autoboot: fix a bunch of misconversion of CONFIG_BOOTDELAY Masahiro Yamada
2016-06-10 15:28   ` Tom Rini
2016-06-10 15:34     ` Joe Hershberger
2016-06-10 15:37       ` Tom Rini
2016-06-10 15:37     ` Masahiro Yamada
2016-06-10 15:43       ` Tom Rini
2016-06-10 15:48         ` Masahiro Yamada
2016-06-10 18:41           ` Tom Rini
2016-06-10 15:20 ` [U-Boot] [PATCH 5/5] autoboot: add CONFIG_AUTOBOOT to allow to not compile autoboot.c Masahiro Yamada
2016-06-10 21:55   ` Soeren Moch
2016-06-10 22:19     ` Tom Rini
2016-06-10 22:38       ` Soeren Moch
2016-06-10 23:13         ` Tom Rini
2016-06-11  6:57           ` Masahiro Yamada

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=575E3ADA.2040109@denx.de \
    --to=hs@denx.de \
    --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.