mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH 1/2] globalvar: Move static inline functions to common/
Date: Tue, 20 Sep 2016 16:26:01 +0200	[thread overview]
Message-ID: <1474381562-4330-1-git-send-email-s.hauer@pengutronix.de> (raw)

These functions will get bigger in the next patch which disqualifies
them as static inline functions.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 common/globalvar.c  | 67 ++++++++++++++++++++++++++++++++++++++++++++++
 include/globalvar.h | 76 +++++------------------------------------------------
 2 files changed, 74 insertions(+), 69 deletions(-)

diff --git a/common/globalvar.c b/common/globalvar.c
index 44e6528..49f7f7d 100644
--- a/common/globalvar.c
+++ b/common/globalvar.c
@@ -437,6 +437,73 @@ int globalvar_add_simple(const char *name, const char *value)
 	return dev_set_param(&global_device, name, value);
 }
 
+int globalvar_add_simple_string(const char *name, char **value)
+{
+	struct param_d *p;
+
+	p = dev_add_param_string(&global_device, name, NULL, NULL,
+		value, NULL);
+
+	if (IS_ERR(p))
+		return PTR_ERR(p);
+
+	return 0;
+}
+
+int globalvar_add_simple_int(const char *name, int *value,
+			     const char *format)
+{
+	struct param_d *p;
+
+	p = dev_add_param_int(&global_device, name, NULL, NULL,
+		value, format, NULL);
+
+	if (IS_ERR(p))
+		return PTR_ERR(p);
+
+	return 0;
+}
+
+int globalvar_add_simple_bool(const char *name, int *value)
+{
+	struct param_d *p;
+
+	p = dev_add_param_bool(&global_device, name, NULL, NULL,
+		value, NULL);
+
+	if (IS_ERR(p))
+		return PTR_ERR(p);
+
+	return 0;
+}
+
+int globalvar_add_simple_enum(const char *name,	int *value,
+			      const char * const *names, int max)
+{
+	struct param_d *p;
+
+	p = dev_add_param_enum(&global_device, name, NULL, NULL,
+		value, names, max, NULL);
+
+	if (IS_ERR(p))
+		return PTR_ERR(p);
+
+	return 0;
+}
+
+int globalvar_add_simple_ip(const char *name, IPaddr_t *ip)
+{
+	struct param_d *p;
+
+	p = dev_add_param_ip(&global_device, name, NULL, NULL,
+		ip, NULL);
+
+	if (IS_ERR(p))
+		return PTR_ERR(p);
+
+	return 0;
+}
+
 static int globalvar_init(void)
 {
 	register_device(&global_device);
diff --git a/include/globalvar.h b/include/globalvar.h
index 1cd8d21..2322efb 100644
--- a/include/globalvar.h
+++ b/include/globalvar.h
@@ -18,75 +18,13 @@ void globalvar_remove(const char *name);
 char *globalvar_get_match(const char *match, const char *separator);
 void globalvar_set_match(const char *match, const char *val);
 
-static inline int globalvar_add_simple_string(const char *name,
-		char **value)
-{
-	struct param_d *p;
-
-	p = dev_add_param_string(&global_device, name, NULL, NULL,
-		value, NULL);
-
-	if (IS_ERR(p))
-		return PTR_ERR(p);
-
-	return 0;
-}
-
-static inline int globalvar_add_simple_int(const char *name,
-		int *value, const char *format)
-{
-	struct param_d *p;
-
-	p = dev_add_param_int(&global_device, name, NULL, NULL,
-		value, format, NULL);
-
-	if (IS_ERR(p))
-		return PTR_ERR(p);
-
-	return 0;
-}
-
-static inline int globalvar_add_simple_bool(const char *name,
-		int *value)
-{
-	struct param_d *p;
-
-	p = dev_add_param_bool(&global_device, name, NULL, NULL,
-		value, NULL);
-
-	if (IS_ERR(p))
-		return PTR_ERR(p);
-
-	return 0;
-}
-
-static inline int globalvar_add_simple_enum(const char *name,
-		int *value, const char * const *names, int max)
-{
-	struct param_d *p;
-
-	p = dev_add_param_enum(&global_device, name, NULL, NULL,
-		value, names, max, NULL);
-
-	if (IS_ERR(p))
-		return PTR_ERR(p);
-
-	return 0;
-}
-
-static inline int globalvar_add_simple_ip(const char *name,
-		IPaddr_t *ip)
-{
-	struct param_d *p;
-
-	p = dev_add_param_ip(&global_device, name, NULL, NULL,
-		ip, NULL);
-
-	if (IS_ERR(p))
-		return PTR_ERR(p);
-
-	return 0;
-}
+int globalvar_add_simple_string(const char *name, char **value);
+int globalvar_add_simple_int(const char *name, int *value,
+			     const char *format);
+int globalvar_add_simple_bool(const char *name, int *value);
+int globalvar_add_simple_enum(const char *name,	int *value,
+			      const char * const *names, int max);
+int globalvar_add_simple_ip(const char *name, IPaddr_t *ip);
 
 int nvvar_load(void);
 void nvvar_print(void);
-- 
2.8.1


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

             reply	other threads:[~2016-09-20 14:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-20 14:26 Sascha Hauer [this message]
2016-09-20 14:26 ` [PATCH 2/2] globalvar: sync with nvvars 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=1474381562-4330-1-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