From: Sam Ravnborg <sam@ravnborg.org>
To: Roman Zippel <zippel@linux-m68k.org>
Cc: linux-kbuild <linux-kbuild@vger.kernel.org>
Subject: Re: kconfig - hex are considered decimal
Date: Sun, 29 Jun 2008 23:29:41 +0200 [thread overview]
Message-ID: <20080629212941.GA10418@uranus.ravnborg.org> (raw)
In-Reply-To: <20080629115120.GA4654@uranus.ravnborg.org>
On Sun, Jun 29, 2008 at 01:51:20PM +0200, Sam Ravnborg wrote:
> Hi Roman.
>
> I was applying an old patch from you that introduces
> conf_set_all_new_symbols().
>
> But when I tested it I noticed that all symbols
> of type "hex" were saved as decimal vlaues in .config.
>
> Sample (first line is with unmodifed kconfig):
>
> -CONFIG_RADIO_ZOLTRIX_PORT=0x20c
> +CONFIG_RADIO_ZOLTRIX_PORT=20c
>
> I guess this has something to do with the way we
> represent a hex value internally. But I have not yet
> dived into it.
>
> Can you see where it goes wrong?
This seems to be the right fix.
Sam
diff --git a/scripts/kconfig/confdata.c b/scripts/kconfig/confdata.c
index 0759761..6f39c80 100644
--- a/scripts/kconfig/confdata.c
+++ b/scripts/kconfig/confdata.c
@@ -510,7 +510,7 @@ int conf_write(const char *name)
case S_HEX:
str = sym_get_string_value(sym);
if (str[0] != '0' || (str[1] != 'x' && str[1] != 'X')) {
- fprintf(out, "CONFIG_%s=%s\n", sym->name, str);
+ fprintf(out, "CONFIG_%s=0x%s\n", sym->name, str);
break;
}
case S_INT:
next prev parent reply other threads:[~2008-06-29 21:28 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-29 11:51 kconfig - hex are considered decimal Sam Ravnborg
2008-06-29 21:29 ` Sam Ravnborg [this message]
2008-06-30 13:19 ` Roman Zippel
2008-06-30 20:40 ` Sam Ravnborg
2008-06-30 21:59 ` Roman Zippel
2008-07-01 6:12 ` Sam Ravnborg
2008-07-02 12:39 ` Roman Zippel
2008-07-06 21:28 ` Sam Ravnborg
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=20080629212941.GA10418@uranus.ravnborg.org \
--to=sam@ravnborg.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=zippel@linux-m68k.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