diff mbox

[1/9] stringify: add HEX_STRING()

Message ID 20110710125109.c72f9c2d.rdunlap@xenotime.net (mailing list archive)
State Under Review
Headers show

Commit Message

Randy Dunlap July 10, 2011, 7:51 p.m. UTC
From: Randy Dunlap <rdunlap@xenotime.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".

Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
---
 include/linux/stringify.h |    7 +++++++
 1 file changed, 7 insertions(+)

NOTE: The other 8 patches are on lkml and linux-media mailing lists.

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Mauro Carvalho Chehab July 13, 2011, 9:05 p.m. UTC | #1
Em 10-07-2011 16:51, Randy Dunlap escreveu:
> From: Randy Dunlap <rdunlap@xenotime.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".

Hi Randy,

After applying patch 1/9 and 2/9 over 3.0-rc7+media patches, I'm
now getting this error:

drivers/media/radio/radio-aimslab.c:52:1: error: invalid suffix "x20f" on integer constant

$ grep 20f .config
CONFIG_RADIO_RTRACK_PORT=20f

$ gcc --version
gcc (GCC) 4.4.5 20110214 (Red Hat 4.4.5-6)

Before this patch, this were working (or, at least, weren't producing
any error).

Perhaps the breakage on your compilation happened due to another
patch at the tree? If so, the better would be to apply this patch
series together with the ones that caused the breakage, to avoid
bisect troubles.

> 
> Signed-off-by: Randy Dunlap <rdunlap@xenotime.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)
> +
>  #endif	/* !__LINUX_STRINGIFY_H */

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Randy Dunlap July 13, 2011, 9:11 p.m. UTC | #2
On Wed, 13 Jul 2011 18:05:45 -0300 Mauro Carvalho Chehab wrote:

> Em 10-07-2011 16:51, Randy Dunlap escreveu:
> > From: Randy Dunlap <rdunlap@xenotime.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".
> 
> Hi Randy,
> 
> After applying patch 1/9 and 2/9 over 3.0-rc7+media patches, I'm
> now getting this error:
> 
> drivers/media/radio/radio-aimslab.c:52:1: error: invalid suffix "x20f" on integer constant

Hi Mauro,

I built all of these drivers with my patches applied,
but I'll see if I can find where this error is coming from.

Thanks for checking & letting me know.


> $ grep 20f .config
> CONFIG_RADIO_RTRACK_PORT=20f
> 
> $ gcc --version
> gcc (GCC) 4.4.5 20110214 (Red Hat 4.4.5-6)
> 
> Before this patch, this were working (or, at least, weren't producing
> any error).
> 
> Perhaps the breakage on your compilation happened due to another
> patch at the tree? If so, the better would be to apply this patch
> series together with the ones that caused the breakage, to avoid
> bisect troubles.
> 
> > 
> > Signed-off-by: Randy Dunlap <rdunlap@xenotime.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)
> > +
> >  #endif	/* !__LINUX_STRINGIFY_H */
> 
> --


---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Arnaud Lacombe July 13, 2011, 9:49 p.m. UTC | #3
Hi,

On Sun, Jul 10, 2011 at 3:51 PM, Randy Dunlap <rdunlap@xenotime.net> wrote:
> From: Randy Dunlap <rdunlap@xenotime.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/

 - Arnaud

> Signed-off-by: Randy Dunlap <rdunlap@xenotime.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...

>  #endif /* !__LINUX_STRINGIFY_H */
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Randy Dunlap July 13, 2011, 10 p.m. UTC | #4
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@xenotime.net> wrote:
> > From: Randy Dunlap <rdunlap@xenotime.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@xenotime.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-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Randy Dunlap July 13, 2011, 10:04 p.m. UTC | #5
On Wed, 13 Jul 2011 18:05:45 -0300 Mauro Carvalho Chehab wrote:

> Em 10-07-2011 16:51, Randy Dunlap escreveu:
> > From: Randy Dunlap <rdunlap@xenotime.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".
> 
> Hi Randy,
> 
> After applying patch 1/9 and 2/9 over 3.0-rc7+media patches, I'm
> now getting this error:
> 
> drivers/media/radio/radio-aimslab.c:52:1: error: invalid suffix "x20f" on integer constant
> 
> $ grep 20f .config
> CONFIG_RADIO_RTRACK_PORT=20f
> 
> $ gcc --version
> gcc (GCC) 4.4.5 20110214 (Red Hat 4.4.5-6)
> 
> Before this patch, this were working (or, at least, weren't producing
> any error).
> 
> Perhaps the breakage on your compilation happened due to another
> patch at the tree? If so, the better would be to apply this patch

Do you suspect that?

I built this patch series against the latest linux-next (20110707),
so it should contain media patches as of that date.

> series together with the ones that caused the breakage, to avoid
> bisect troubles.

Sure, if we know what patch it is (if there indeed is one).

Can you do:
$ make drivers/media/radio/radio-aimslab.i

and tell me what this line contains for you?
Mine says:

static int io = 0x20f;


> > 
> > Signed-off-by: Randy Dunlap <rdunlap@xenotime.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)
> > +
> >  #endif	/* !__LINUX_STRINGIFY_H */
> 
> --


---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Arnaud Lacombe July 13, 2011, 10:06 p.m. UTC | #6
Hi,

On Wed, Jul 13, 2011 at 6:00 PM, Randy Dunlap <rdunlap@xenotime.net> wrote:
> 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@xenotime.net> wrote:
>> > From: Randy Dunlap <rdunlap@xenotime.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@xenotime.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.
>
I meant hackish not because *how* it is done, but because *why* it has
to be done, that is, because the Kconfig miss the prefix, which is
really no big deal.

> How would you do it without (instead of) a kconfig fix/patch?
>
have the Kconfig use the "0x" prefix since the beginning.

 - Arnaud

>> >  #endif /* !__LINUX_STRINGIFY_H */
>> > --
>
>
> ---
> ~Randy
> *** Remember to use Documentation/SubmitChecklist when testing your code ***
>
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Randy Dunlap July 13, 2011, 10:08 p.m. UTC | #7
On Wed, 13 Jul 2011 18:06:15 -0400 Arnaud Lacombe wrote:

> Hi,
> 
> On Wed, Jul 13, 2011 at 6:00 PM, Randy Dunlap <rdunlap@xenotime.net> wrote:
> > 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@xenotime.net> wrote:
> >> > From: Randy Dunlap <rdunlap@xenotime.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@xenotime.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.
> >
> I meant hackish not because *how* it is done, but because *why* it has
> to be done, that is, because the Kconfig miss the prefix, which is
> really no big deal.
> 
> > How would you do it without (instead of) a kconfig fix/patch?
> >
> have the Kconfig use the "0x" prefix since the beginning.


Sure, go for it.  I'll ack it.  ;)  [or Review it :]
and test it.

thanks,
---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Arnaud Lacombe July 13, 2011, 10:13 p.m. UTC | #8
Hi,

On Wed, Jul 13, 2011 at 6:08 PM, Randy Dunlap <rdunlap@xenotime.net> wrote:
> On Wed, 13 Jul 2011 18:06:15 -0400 Arnaud Lacombe wrote:
>
>> Hi,
>>
>> On Wed, Jul 13, 2011 at 6:00 PM, Randy Dunlap <rdunlap@xenotime.net> wrote:
>> > 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@xenotime.net> wrote:
>> >> > From: Randy Dunlap <rdunlap@xenotime.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@xenotime.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.
>> >
>> I meant hackish not because *how* it is done, but because *why* it has
>> to be done, that is, because the Kconfig miss the prefix, which is
>> really no big deal.
>>
>> > How would you do it without (instead of) a kconfig fix/patch?
>> >
>> have the Kconfig use the "0x" prefix since the beginning.
>
> Sure, go for it.  I'll ack it.  ;)  [or Review it :]
> and test it.
>
it is already among the hunks in https://patchwork.kernel.org/patch/380601/

 - Arnaud
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Randy Dunlap July 13, 2011, 10:17 p.m. UTC | #9
On Wed, 13 Jul 2011 18:13:31 -0400 Arnaud Lacombe wrote:

> Hi,
> 
> On Wed, Jul 13, 2011 at 6:08 PM, Randy Dunlap <rdunlap@xenotime.net> wrote:
> > On Wed, 13 Jul 2011 18:06:15 -0400 Arnaud Lacombe wrote:
> >
> >> Hi,
> >>
> >> On Wed, Jul 13, 2011 at 6:00 PM, Randy Dunlap <rdunlap@xenotime.net> wrote:
> >> > 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@xenotime.net> wrote:
> >> >> > From: Randy Dunlap <rdunlap@xenotime.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@xenotime.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.
> >> >
> >> I meant hackish not because *how* it is done, but because *why* it has
> >> to be done, that is, because the Kconfig miss the prefix, which is
> >> really no big deal.
> >>
> >> > How would you do it without (instead of) a kconfig fix/patch?
> >> >
> >> have the Kconfig use the "0x" prefix since the beginning.
> >
> > Sure, go for it.  I'll ack it.  ;)  [or Review it :]
> > and test it.
> >
> it is already among the hunks in https://patchwork.kernel.org/patch/380601/

I realize that, but it looks like you may need to resubmit it.

I'll dig it out and test it, maybe even reply to your old patch(es).

---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Arnaud Lacombe July 14, 2011, 4:03 a.m. UTC | #10
Hi,

On Wed, Jul 13, 2011 at 6:17 PM, Randy Dunlap <rdunlap@xenotime.net> wrote:
> [...]
>> > Sure, go for it.  I'll ack it.  ;)  [or Review it :]
>> > and test it.
>> >
>> it is already among the hunks in https://patchwork.kernel.org/patch/380601/
>
> I realize that, but it looks like you may need to resubmit it.
>
I have an updated set of patches against -next, I still need to break
them down by tree. As a lots of things I did today went completely
south, I guess it would be better if I do this task early tomorrow :-)

 - Arnaud
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

--- 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)
+
 #endif	/* !__LINUX_STRINGIFY_H */