mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* device parameter patches
@ 2012-05-13 12:04 Sascha Hauer
  2012-05-13 12:04 ` [PATCH 1/2] parameter: return empty string for unset parameters Sascha Hauer
  2012-05-13 12:04 ` [PATCH 2/2] parameter: remove unused struct member Sascha Hauer
  0 siblings, 2 replies; 3+ messages in thread
From: Sascha Hauer @ 2012-05-13 12:04 UTC (permalink / raw)
  To: barebox

Two small patches...

Sascha

----------------------------------------------------------------
Sascha Hauer (2):
      parameter: return empty string for unset parameters
      parameter: remove unused struct member

 include/param.h |    1 -
 lib/parameter.c |    2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] parameter: return empty string for unset parameters
  2012-05-13 12:04 device parameter patches Sascha Hauer
@ 2012-05-13 12:04 ` Sascha Hauer
  2012-05-13 12:04 ` [PATCH 2/2] parameter: remove unused struct member Sascha Hauer
  1 sibling, 0 replies; 3+ messages in thread
From: Sascha Hauer @ 2012-05-13 12:04 UTC (permalink / raw)
  To: barebox

Currently we return NULL for unset parameters. As we can't set them
back to NULL once set this is not very consistent. Return an empty
string instead.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 lib/parameter.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/parameter.c b/lib/parameter.c
index baf7720..c75c21e 100644
--- a/lib/parameter.c
+++ b/lib/parameter.c
@@ -135,7 +135,7 @@ int dev_param_set_generic(struct device_d *dev, struct param_d *p,
 
 static const char *param_get_generic(struct device_d *dev, struct param_d *p)
 {
-	return p->value;
+	return p->value ? p->value : "";
 }
 
 static struct param_d *__dev_add_param(struct device_d *dev, const char *name,
-- 
1.7.10


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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 2/2] parameter: remove unused struct member
  2012-05-13 12:04 device parameter patches Sascha Hauer
  2012-05-13 12:04 ` [PATCH 1/2] parameter: return empty string for unset parameters Sascha Hauer
@ 2012-05-13 12:04 ` Sascha Hauer
  1 sibling, 0 replies; 3+ messages in thread
From: Sascha Hauer @ 2012-05-13 12:04 UTC (permalink / raw)
  To: barebox

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 include/param.h |    1 -
 1 file changed, 1 deletion(-)

diff --git a/include/param.h b/include/param.h
index e7b66a4..a855102 100644
--- a/include/param.h
+++ b/include/param.h
@@ -14,7 +14,6 @@ struct param_d {
 	int (*set)(struct device_d *, struct param_d *param, const char *val);
 	unsigned int flags;
 	char *name;
-	struct param_d *next;
 	char *value;
 	struct list_head list;
 };
-- 
1.7.10


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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-05-13 12:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-13 12:04 device parameter patches Sascha Hauer
2012-05-13 12:04 ` [PATCH 1/2] parameter: return empty string for unset parameters Sascha Hauer
2012-05-13 12:04 ` [PATCH 2/2] parameter: remove unused struct member Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox