]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
of/fdt: Make fdt blob input parameters of unflatten functions const
authorGeert Uytterhoeven <geert+renesas@glider.be>
Wed, 13 May 2015 14:33:56 +0000 (16:33 +0200)
committerRob Herring <robh@kernel.org>
Thu, 28 May 2015 18:00:25 +0000 (13:00 -0500)
Operations to unflatten fdt blobs never modify the input blobs, hence
make them const. Now we no longer need to cast arbitrary const data to
"void *" when calling of_fdt_unflatten_tree().

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Rob Herring <robh@kernel.org>
drivers/of/fdt.c
include/linux/of_fdt.h

index cde35c5d0191bd5950c7953d5b8e88a2d139306f..9628c4a77f76e55f74e43bc9b720603946569459 100644 (file)
@@ -168,7 +168,7 @@ static void *unflatten_dt_alloc(void **mem, unsigned long size,
  * @dad: Parent struct device_node
  * @fpsize: Size of the node path up at the current depth.
  */
-static void * unflatten_dt_node(void *blob,
+static void * unflatten_dt_node(const void *blob,
                                void *mem,
                                int *poffset,
                                struct device_node *dad,
@@ -378,7 +378,7 @@ static void * unflatten_dt_node(void *blob,
  * @dt_alloc: An allocator that provides a virtual address to memory
  * for the resulting tree
  */
-static void __unflatten_device_tree(void *blob,
+static void __unflatten_device_tree(const void *blob,
                             struct device_node **mynodes,
                             void * (*dt_alloc)(u64 size, u64 align))
 {
@@ -441,7 +441,7 @@ static void *kernel_tree_alloc(u64 size, u64 align)
  * pointers of the nodes so the normal device-tree walking functions
  * can be used.
  */
-void of_fdt_unflatten_tree(unsigned long *blob,
+void of_fdt_unflatten_tree(const unsigned long *blob,
                        struct device_node **mynodes)
 {
        __unflatten_device_tree(blob, mynodes, &kernel_tree_alloc);
index 587ee507965d78a1b16112a0e3c0bba7856f1d3e..0cf217d404ce466095aab32f19de115f02250aaa 100644 (file)
@@ -37,7 +37,7 @@ extern bool of_fdt_is_big_endian(const void *blob,
                                 unsigned long node);
 extern int of_fdt_match(const void *blob, unsigned long node,
                        const char *const *compat);
-extern void of_fdt_unflatten_tree(unsigned long *blob,
+extern void of_fdt_unflatten_tree(const unsigned long *blob,
                               struct device_node **mynodes);
 
 /* TBD: Temporary export of fdt globals - remove when code fully merged */