Skip to contentSkip to conversation

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

PATCH New Chen Gang S 1 participant 1 message Mar 1, 2015 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/1 c6x: kernel: setup: Type cast 'fdt' to "void *" for early_init_dt_scan() in machine_init()

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:31:29 +0800
From: Chen Gang <[email protected]>
To: [email protected], [email protected]
CC: [email protected], [email protected] <[email protected]>

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);
               ^
---
 arch/c6x/kernel/setup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/c6x/kernel/setup.c +1 -1
index a5f6e0e..e5ea757 100644
@@ -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();
 }
Signature · 1 line
1.9.3