LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* Fwd: [PATCH] c6x: kernel: setup: Type cast 'fdt' to "void *" for early_init_dt_scan() in machine_init()
       [not found] <54F2C9B1.4090403@qq.com>
@ 2015-03-01  8:21 ` Chen Gang S
  2015-03-03 17:10 ` Mark Salter
  1 sibling, 0 replies; 3+ messages in thread
From: Chen Gang S @ 2015-03-01  8:21 UTC (permalink / raw)
  To: Chen Gang, linux-kernel


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@qq.com>
To: msalter@redhat.com, a-jacquiot@ti.com, robh@kernel.org
CC: linux-c6x-dev@linux-c6x.org <linux-c6x-dev@linux-c6x.org>, linux-kernel@vger.kernel.org <linux-kernel@vger.kernel.org>

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@gmail.com>
---
 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



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

* Re: [PATCH] c6x: kernel: setup: Type cast 'fdt' to "void *" for early_init_dt_scan() in machine_init()
       [not found] <54F2C9B1.4090403@qq.com>
  2015-03-01  8:21 ` Fwd: [PATCH] c6x: kernel: setup: Type cast 'fdt' to "void *" for early_init_dt_scan() in machine_init() Chen Gang S
@ 2015-03-03 17:10 ` Mark Salter
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Salter @ 2015-03-03 17:10 UTC (permalink / raw)
  To: Chen Gang; +Cc: a-jacquiot, robh, linux-c6x-dev, linux-kernel

On Sun, 2015-03-01 at 16:11 +0800, Chen Gang wrote:
> 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@gmail.com>
> ---
>  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();
>  }

I don't like the cast. I think the thing to do is just remove the const
from local variables.



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

* Fwd: [PATCH] c6x: kernel: setup: Type cast 'fdt' to "void *" for early_init_dt_scan() in machine_init()
       [not found] <54F2CE61.8020102@qq.com>
@ 2015-03-01  8:32 ` Chen Gang S
  0 siblings, 0 replies; 3+ messages in thread
From: Chen Gang S @ 2015-03-01  8:32 UTC (permalink / raw)
  To: Chen Gang, linux-kernel


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 <762976180@qq.com>
To: msalter@redhat.com, a-jacquiot@ti.com
CC: linux-c6x-dev@linux-c6x.org, linux-kernel@vger.kernel.org <linux-kernel@vger.kernel.org>

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@gmail.com>
---
 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



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

end of thread, other threads:[~2015-03-03 17:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <54F2C9B1.4090403@qq.com>
2015-03-01  8:21 ` Fwd: [PATCH] c6x: kernel: setup: Type cast 'fdt' to "void *" for early_init_dt_scan() in machine_init() Chen Gang S
2015-03-03 17:10 ` Mark Salter
     [not found] <54F2CE61.8020102@qq.com>
2015-03-01  8:32 ` Fwd: " Chen Gang S

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).