All of lore.kernel.org
 help / color / mirror / Atom feed
From: Masahiro Yamada <yamada.masahiro@socionext.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/5] tools: fix define2mk.sed to not add quotes around negative integers
Date: Sat, 11 Jun 2016 00:20:19 +0900	[thread overview]
Message-ID: <1465572021-13692-4-git-send-email-yamada.masahiro@socionext.com> (raw)
In-Reply-To: <1465572021-13692-1-git-send-email-yamada.masahiro@socionext.com>

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(+)

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
-- 
1.9.1

  parent reply	other threads:[~2016-06-10 15:20 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 ` Masahiro Yamada [this message]
2016-06-13  4:47   ` [U-Boot] [PATCH 3/5] tools: fix define2mk.sed to not add quotes around negative integers Heiko Schocher
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=1465572021-13692-4-git-send-email-yamada.masahiro@socionext.com \
    --to=yamada.masahiro@socionext.com \
    --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.