[PATCH 21/24] kconfig: prefix hex values with 0x in .config



We could hit a situation where hex values
are stored internally in kconfig without 0x prefix, so if we see
one of these add 0x prefix when we write value to .config.
The real fix is to make sure we always prefix hex
values with 0x in kconfig.

Signed-off-by: Sam Ravnborg <sam@xxxxxxxxxxxx>
Cc: Roman Zippel <zippel@xxxxxxxxxxxxxx>
---
arch/x86/boot/compressed/relocs.c | 2 +-
scripts/kconfig/confdata.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/boot/compressed/relocs.c b/arch/x86/boot/compressed/relocs.c
index edaadea..88d27f6 100644
--- a/arch/x86/boot/compressed/relocs.c
+++ b/arch/x86/boot/compressed/relocs.c
@@ -244,7 +244,7 @@ static void read_ehdr(FILE *fp)
static void read_shdrs(FILE *fp)
{
int i;
- if (ehdr.e_shnum > MAX_SHDRS) {
+ if (1 || ehdr.e_shnum > MAX_SHDRS) {
die("%d section headers supported: %d\n",
ehdr.e_shnum, MAX_SHDRS);
}
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:
--
1.5.6.1.93.gef98

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: linux-next: kbuild tree build failure
    ... the CONFIG_ prefix, which is often ignored when scanning) contains ... config variable on PPC64 as the PPC32 address split reason is moot. ... hex "PINT3_ASSIGN" ... the number of digits input? ...
    (Linux-Kernel)
  • Re: LUA coders: how to limit Editboxes to a number range
    ... Many color tables on the web give values in hex ... I'd suggest accepting either a "0x" prefix (for C ... programmers) or a "h" suffix (for assembler programmers). ... a "#" prefix for web coders. ...
    (alt.games.warcraft)
  • Re: duplicate ops (Re: updated assembler)
    ... I didn't mean HEX in my question which was about: ... are required to come after the REX, since they are part of the opcode (and ... any other prefix is required to come prior to REX. ... a fast first match finding by hash and contiunue with details there ...
    (alt.lang.asm)
  • Re: changing the decimal to hex
    ... If the user is storing the Hex numbers with the &H prefix then my solution ... Center for Health Program Development and Management ...
    (microsoft.public.access.queries)
  • Re: [PATCH 21/24] kconfig: prefix hex values with 0x in .config
    ... one of these add 0x prefix when we write value to .config. ... values with 0x in kconfig. ... stale x86 change slipped into this patch, ... MAX_SHDRS debug patch yesterday) ...
    (Linux-Kernel)