Patchwork [RFC,v1,2/3] device_tree: qemu_fdt_setprop: Rename val_array arg

login
register
mail settings
Submitter Peter Crosthwaite
Date July 12, 2013, 4:29 a.m.
Message ID <311d6862f24292bb5099467f34eb5cbcf81fc708.1373603020.git.peter.crosthwaite@xilinx.com>
Download mbox | patch
Permalink /patch/258686/
State New
Headers show

Comments

Peter Crosthwaite - July 12, 2013, 4:29 a.m.
From: Peter Crosthwaite <peter.crosthwaite@xilinx.com>

Looking at the implementation, this doesn't really have a lot to do
with arrays. Its just a pointer to a buffer and is passed through
to the wrapped fn (qemu_fdt_setprop) unchanged. So rename to make it
consistent with libfdt, which in the wrapped function just calls it
"val".

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
---

 device_tree.c                | 4 ++--
 include/sysemu/device_tree.h | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
Andreas Färber - July 20, 2013, 11:44 a.m.
Am 12.07.2013 06:29, schrieb peter.crosthwaite@xilinx.com:
> From: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
> 
> Looking at the implementation, this doesn't really have a lot to do
> with arrays. Its just a pointer to a buffer and is passed through
> to the wrapped fn (qemu_fdt_setprop) unchanged. So rename to make it
> consistent with libfdt, which in the wrapped function just calls it
> "val".
> 
> Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
> ---
> 
>  device_tree.c                | 4 ++--
>  include/sysemu/device_tree.h | 2 +-
>  2 files changed, 3 insertions(+), 3 deletions(-)

Reviewed-by: Andreas Färber <afaerber@suse.de>

Andreas

Patch

diff --git a/device_tree.c b/device_tree.c
index 9df78c2..048b8e1 100644
--- a/device_tree.c
+++ b/device_tree.c
@@ -127,11 +127,11 @@  static int findnode_nofail(void *fdt, const char *node_path)
 }
 
 int qemu_fdt_setprop(void *fdt, const char *node_path,
-                     const char *property, const void *val_array, int size)
+                     const char *property, const void *val, int size)
 {
     int r;
 
-    r = fdt_setprop(fdt, findnode_nofail(fdt, node_path), property, val_array, size);
+    r = fdt_setprop(fdt, findnode_nofail(fdt, node_path), property, val, size);
     if (r < 0) {
         fprintf(stderr, "%s: Couldn't set %s/%s: %s\n", __func__, node_path,
                 property, fdt_strerror(r));
diff --git a/include/sysemu/device_tree.h b/include/sysemu/device_tree.h
index 19a017e..b4650c5 100644
--- a/include/sysemu/device_tree.h
+++ b/include/sysemu/device_tree.h
@@ -18,7 +18,7 @@  void *create_device_tree(int *sizep);
 void *load_device_tree(const char *filename_path, int *sizep);
 
 int qemu_fdt_setprop(void *fdt, const char *node_path,
-                     const char *property, const void *val_array, int size);
+                     const char *property, const void *val, int size);
 int qemu_fdt_setprop_cell(void *fdt, const char *node_path,
                           const char *property, uint32_t val);
 int qemu_fdt_setprop_u64(void *fdt, const char *node_path,