mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/2] stringlist: the string argument should be const
@ 2014-12-03 14:33 Jan Luebbe
  2014-12-03 14:34 ` [PATCH 2/2] fdt: of_unflatten_dtb can work on const data Jan Luebbe
  2014-12-04  7:24 ` [PATCH 1/2] stringlist: the string argument should be const Sascha Hauer
  0 siblings, 2 replies; 3+ messages in thread
From: Jan Luebbe @ 2014-12-03 14:33 UTC (permalink / raw)
  To: barebox

Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
---
 include/stringlist.h | 4 ++--
 lib/stringlist.c     | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/stringlist.h b/include/stringlist.h
index 2e2addf98f19..e85500a99485 100644
--- a/include/stringlist.h
+++ b/include/stringlist.h
@@ -8,9 +8,9 @@ struct string_list {
 	char *str;
 };
 
-int string_list_add(struct string_list *sl, char *str);
+int string_list_add(struct string_list *sl, const char *str);
 int string_list_add_asprintf(struct string_list *sl, const char *fmt, ...);
-int string_list_add_sorted(struct string_list *sl, char *str);
+int string_list_add_sorted(struct string_list *sl, const char *str);
 int string_list_contains(struct string_list *sl, const char *str);
 void string_list_print_by_column(struct string_list *sl);
 
diff --git a/lib/stringlist.c b/lib/stringlist.c
index 57801b3bb04d..8a18366a96d5 100644
--- a/lib/stringlist.c
+++ b/lib/stringlist.c
@@ -13,7 +13,7 @@ static int string_list_compare(struct list_head *a, struct list_head *b)
 	return strcmp(astr, bstr);
 }
 
-int string_list_add(struct string_list *sl, char *str)
+int string_list_add(struct string_list *sl, const char *str)
 {
 	struct string_list *new;
 
@@ -48,7 +48,7 @@ int string_list_add_asprintf(struct string_list *sl, const char *fmt, ...)
 	return 0;
 }
 
-int string_list_add_sorted(struct string_list *sl, char *str)
+int string_list_add_sorted(struct string_list *sl, const char *str)
 {
 	struct string_list *new;
 
-- 
2.1.3


_______________________________________________
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] fdt: of_unflatten_dtb can work on const data
  2014-12-03 14:33 [PATCH 1/2] stringlist: the string argument should be const Jan Luebbe
@ 2014-12-03 14:34 ` Jan Luebbe
  2014-12-04  7:24 ` [PATCH 1/2] stringlist: the string argument should be const Sascha Hauer
  1 sibling, 0 replies; 3+ messages in thread
From: Jan Luebbe @ 2014-12-03 14:34 UTC (permalink / raw)
  To: barebox

Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
---
 drivers/of/fdt.c | 4 ++--
 include/of.h     | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index cfe183350978..89f291787962 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -54,7 +54,7 @@ static inline char *dt_string(struct fdt_header *f, char *strstart, uint32_t ofs
  * Parse a flat device tree binary blob and return a pointer to the
  * unflattened tree.
  */
-struct device_node *of_unflatten_dtb(void *infdt)
+struct device_node *of_unflatten_dtb(const void *infdt)
 {
 	const void *nodep;	/* property node pointer */
 	uint32_t tag;		/* tag */
@@ -69,7 +69,7 @@ struct device_node *of_unflatten_dtb(void *infdt)
 	struct fdt_header f;
 	int ret;
 	unsigned int maxlen;
-	struct fdt_header *fdt = infdt;
+	const struct fdt_header *fdt = infdt;
 
 	if (fdt->magic != cpu_to_fdt32(FDT_MAGIC)) {
 		pr_err("bad magic: 0x%08x\n", fdt32_to_cpu(fdt->magic));
diff --git a/include/of.h b/include/of.h
index 7b93c58474de..5273f87ebd1d 100644
--- a/include/of.h
+++ b/include/of.h
@@ -98,7 +98,7 @@ void of_print_cmdline(struct device_node *root);
 void of_print_nodes(struct device_node *node, int indent);
 int of_probe(void);
 int of_parse_dtb(struct fdt_header *fdt);
-struct device_node *of_unflatten_dtb(void *fdt);
+struct device_node *of_unflatten_dtb(const void *fdt);
 
 struct cdev;
 
-- 
2.1.3


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

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

* Re: [PATCH 1/2] stringlist: the string argument should be const
  2014-12-03 14:33 [PATCH 1/2] stringlist: the string argument should be const Jan Luebbe
  2014-12-03 14:34 ` [PATCH 2/2] fdt: of_unflatten_dtb can work on const data Jan Luebbe
@ 2014-12-04  7:24 ` Sascha Hauer
  1 sibling, 0 replies; 3+ messages in thread
From: Sascha Hauer @ 2014-12-04  7:24 UTC (permalink / raw)
  To: Jan Luebbe; +Cc: barebox

On Wed, Dec 03, 2014 at 03:33:59PM +0100, Jan Luebbe wrote:
> Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
> ---
>  include/stringlist.h | 4 ++--
>  lib/stringlist.c     | 4 ++--
>  2 files changed, 4 insertions(+), 4 deletions(-)

Applied both, thanks

Sascha


-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
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:[~2014-12-04  7:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-03 14:33 [PATCH 1/2] stringlist: the string argument should be const Jan Luebbe
2014-12-03 14:34 ` [PATCH 2/2] fdt: of_unflatten_dtb can work on const data Jan Luebbe
2014-12-04  7:24 ` [PATCH 1/2] stringlist: the string argument should be const Sascha Hauer

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