[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20110713150023.0dde9ef4.rdunlap@xenotime.net>
Date: Wed, 13 Jul 2011 15:00:23 -0700
From: Randy Dunlap <rdunlap@...otime.net>
To: Arnaud Lacombe <lacombar@...il.com>
Cc: lkml <linux-kernel@...r.kernel.org>, linux-kbuild@...r.kernel.org,
linux-media@...r.kernel.org, mchehab@...radead.org
Subject: Re: [PATCH 1/9] stringify: add HEX_STRING()
On Wed, 13 Jul 2011 17:49:48 -0400 Arnaud Lacombe wrote:
> Hi,
>
> On Sun, Jul 10, 2011 at 3:51 PM, Randy Dunlap <rdunlap@...otime.net> wrote:
> > From: Randy Dunlap <rdunlap@...otime.net>
> >
> > Add HEX_STRING(value) to stringify.h so that drivers can
> > convert kconfig hex values (without leading "0x") to useful
> > hex constants.
> >
> > Several drivers/media/radio/ drivers need this. I haven't
> > checked if any other drivers need to do this.
> >
> > Alternatively, kconfig could produce hex config symbols with
> > leading "0x".
> >
> Actually, I used to have a patch to make hex value have a mandatory
> "0x" prefix, in the Kconfig. I even fixed all the issue in the tree,
> it never make it to the tree (not sure why). Here's the relevant
> thread:
>
> https://patchwork.kernel.org/patch/380591/
> https://patchwork.kernel.org/patch/380621/
> https://patchwork.kernel.org/patch/380601/
>
I prefer that this be fixed in kconfig, so long as it won't cause
any other issues. That's why I mentioned it.
>
> > Signed-off-by: Randy Dunlap <rdunlap@...otime.net>
> > ---
> > include/linux/stringify.h | 7 +++++++
> > 1 file changed, 7 insertions(+)
> >
> > NOTE: The other 8 patches are on lkml and linux-media mailing lists.
> >
> > --- linux-next-20110707.orig/include/linux/stringify.h
> > +++ linux-next-20110707/include/linux/stringify.h
> > @@ -9,4 +9,11 @@
> > #define __stringify_1(x...) #x
> > #define __stringify(x...) __stringify_1(x)
> >
> > +/*
> > + * HEX_STRING(value) is useful for CONFIG_ values that are in hex,
> > + * but kconfig does not put a leading "0x" on them.
> > + */
> > +#define HEXSTRINGVALUE(h, value) h##value
> > +#define HEX_STRING(value) HEXSTRINGVALUE(0x, value)
> > +
> that seems hackish...
It's a common idiom for concatenating strings in the kernel.
How would you do it without (instead of) a kconfig fix/patch?
> > #endif /* !__LINUX_STRINGIFY_H */
> > --
---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists