All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaud Lacombe <lacombar@gmail.com>
To: Randy Dunlap <rdunlap@xenotime.net>
Cc: lkml <linux-kernel@vger.kernel.org>,
	linux-kbuild@vger.kernel.org, linux-media@vger.kernel.org,
	mchehab@infradead.org
Subject: Re: [PATCH 1/9] stringify: add HEX_STRING()
Date: Wed, 13 Jul 2011 18:06:15 -0400	[thread overview]
Message-ID: <CACqU3MVh+4JMX5ywPgWrrXXuAcAYtHJyumXGDcteageJAG12wA@mail.gmail.com> (raw)
In-Reply-To: <20110713150023.0dde9ef4.rdunlap@xenotime.net>

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 ***
>

  reply	other threads:[~2011-07-13 22:06 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-10 19:51 [PATCH 1/9] stringify: add HEX_STRING() Randy Dunlap
2011-07-10 19:53 ` [PATCH 2/9] media/radio: fix aimslab CONFIG IO PORT Randy Dunlap
2011-07-15  1:44   ` Arnaud Lacombe
2011-07-10 19:54 ` [PATCH 3/9] media/radio: fix aztech " Randy Dunlap
2011-07-10 19:55 ` [PATCH 4/9] media/radio: fix gemtek " Randy Dunlap
2011-07-10 19:56 ` [PATCH 5/9] media/radio: fix rtrack2 " Randy Dunlap
2011-07-10 19:57 ` [PATCH 6/9] media/radio: fix terratec " Randy Dunlap
2011-07-10 19:58 ` [PATCH 7/9] media/radio: fix trust " Randy Dunlap
2011-07-10 19:59 ` [PATCH 8/9] media/radio: fix typhoon " Randy Dunlap
2011-07-10 19:59 ` [PATCH 9/9] media/radio: fix zoltrix " Randy Dunlap
2011-07-13 21:05 ` [PATCH 1/9] stringify: add HEX_STRING() Mauro Carvalho Chehab
2011-07-13 21:11   ` Randy Dunlap
2011-07-13 22:04   ` Randy Dunlap
2011-07-13 21:49 ` Arnaud Lacombe
2011-07-13 22:00   ` Randy Dunlap
2011-07-13 22:06     ` Arnaud Lacombe [this message]
2011-07-13 22:08       ` Randy Dunlap
2011-07-13 22:13         ` Arnaud Lacombe
2011-07-13 22:17           ` Randy Dunlap
2011-07-14  4:03             ` Arnaud Lacombe
2011-07-14 17:26             ` [PATCH] media/Kconfig: fix hexadecimal prefix for `hex' symbols Arnaud Lacombe
2011-07-14 18:16               ` Mauro Carvalho Chehab
2011-07-14 18:47                 ` Arnaud Lacombe
2011-07-14 23:32                 ` Arnaud Lacombe
2011-07-15  0:01                   ` Mauro Carvalho Chehab
2011-07-15  1:39                     ` Arnaud Lacombe
2011-07-24 21:38               ` Arnaud Lacombe

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=CACqU3MVh+4JMX5ywPgWrrXXuAcAYtHJyumXGDcteageJAG12wA@mail.gmail.com \
    --to=lacombar@gmail.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@infradead.org \
    --cc=rdunlap@xenotime.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.