public inbox for linux-kbuild@vger.kernel.org
 help / color / mirror / Atom feed
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: Mon, 30 Jun 2008 22:40:32 +0200	[thread overview]
Message-ID: <20080630204032.GA29429@uranus.ravnborg.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0806301404270.6791@localhost.localdomain>

On Mon, Jun 30, 2008 at 03:19:09PM +0200, Roman Zippel wrote:
> Hi,
> 
> On Sun, 29 Jun 2008, Sam Ravnborg wrote:
> 
> > 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?
> 
> It's not really wrong, it's a valid value there. Only if it's saved like 
> this in the header file, it would be wrong.
> I noticed that during testing too, that value is coming liking that 
> directly from the Kconfig file. The real fix would be to deprecate hex 
> values without prefix and automatically adding the prefix where needed 
> (currently loading of Kconfig/.config).
> I though about making it more consistent, but it's not really a pressing 
> issue, so I left it as is for now.

For now I added this patch (for previous mail).
This makes the configs equal so they can be compared.

	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:


  reply	other threads:[~2008-06-30 20:39 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
2008-06-30 13:19 ` Roman Zippel
2008-06-30 20:40   ` Sam Ravnborg [this message]
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=20080630204032.GA29429@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