Fwd: [PATCH] c6x: kernel: setup: Type cast 'fdt' to "void *" for early_init_dt_scan() in machine_init()

From: Chen Gang S
Date: Sun Mar 01 2015 - 03:14:39 EST



Just forward to linux kernel mailing list.

Thanks.

-------- Forwarded Message --------
Subject: [PATCH] c6x: kernel: setup: Type cast 'fdt' to "void *" for early_init_dt_scan() in machine_init()
Date: Sun, 01 Mar 2015 16:11:29 +0800
From: Chen Gang <762976180@xxxxxx>
To: msalter@xxxxxxxxxx, a-jacquiot@xxxxxx, robh@xxxxxxxxxx
CC: linux-c6x-dev@xxxxxxxxxxxxx <linux-c6x-dev@xxxxxxxxxxxxx>, linux-kernel@xxxxxxxxxxxxxxx <linux-kernel@xxxxxxxxxxxxxxx>

early_init_dt_scan() accepts "void *", so c6x needs to type cast 'fdt'
to "void *" to avoid warning:

CC arch/c6x/kernel/setup.o
arch/c6x/kernel/setup.c: In function 'machine_init':
arch/c6x/kernel/setup.c:290:21: warning: passing argument 1 of 'early_init_dt_scan' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
early_init_dt_scan(fdt);
^
In file included from arch/c6x/kernel/setup.c:19:0:
include/linux/of_fdt.h:75:13: note: expected 'void *' but argument is of type 'const void *'
extern bool early_init_dt_scan(void *params);
^

Signed-off-by: Chen Gang <gang.chen.5i5j@xxxxxxxxx>
---
arch/c6x/kernel/setup.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/c6x/kernel/setup.c b/arch/c6x/kernel/setup.c
index a5f6e0e..e5ea757 100644
--- a/arch/c6x/kernel/setup.c
+++ b/arch/c6x/kernel/setup.c
@@ -289,7 +289,7 @@ notrace void __init machine_init(unsigned long dt_ptr)
fdt = dtb;

/* Do some early initialization based on the flat device tree */
- early_init_dt_scan(fdt);
+ early_init_dt_scan((void *)fdt);

parse_early_param();
}
--
1.9.3


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/