mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 1/2] magicvar: Add magicvar macro with additional name argument
Date: Tue, 15 May 2012 09:07:33 +0200	[thread overview]
Message-ID: <1337065654-17925-2-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1337065654-17925-1-git-send-email-s.hauer@pengutronix.de>

Currently magicvar fails on variables containing a '.' because we can't
use these as C names. Overcome this by adding a new macro which allows
to specify a name seperately.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 include/magicvar.h |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/include/magicvar.h b/include/magicvar.h
index d27a2e3..bb5bd25 100644
--- a/include/magicvar.h
+++ b/include/magicvar.h
@@ -18,14 +18,18 @@ extern struct magicvar __barebox_magicvar_end;
 #endif
 
 #ifdef CONFIG_CMD_MAGICVAR
-#define BAREBOX_MAGICVAR(_name, _description)			\
+#define BAREBOX_MAGICVAR_NAMED(_name, _varname, _description)			\
 extern const struct magicvar __barebox_magicvar_##_name;	\
 const struct magicvar __barebox_magicvar_##_name		\
         __attribute__ ((unused,section (".barebox_magicvar_" __stringify(_name)))) = {	\
-        .name	= #_name,					\
+        .name	= #_varname,					\
 	.description = MAGICVAR_DESCRIPTION(_description),	\
 };
+
+#define BAREBOX_MAGICVAR(_name, _description)			\
+	BAREBOX_MAGICVAR_NAMED(_name, _name, _description)
 #else
+#define BAREBOX_MAGICVAR_NAMED(_name, _varname, _description)
 #define BAREBOX_MAGICVAR(_name, _description)
 #endif
 
-- 
1.7.10


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2012-05-15  7:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-15  7:07 Add magicvar description for flexible bootargs Sascha Hauer
2012-05-15  7:07 ` Sascha Hauer [this message]
2012-05-15  7:07 ` [PATCH 2/2] flexible bootargs: Add magicvar descriptions Sascha Hauer

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=1337065654-17925-2-git-send-email-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.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