LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH v2] c6x: kernel: setup: Remove 'const' for local variables in machine_init
@ 2015-03-03 20:55 Chen Gang
  2015-03-26 14:13 ` Mark Salter
  0 siblings, 1 reply; 2+ messages in thread
From: Chen Gang @ 2015-03-03 20:55 UTC (permalink / raw)
  To: msalter, a-jacquiot; +Cc: robh, linux-c6x-dev, linux-kernel

early_init_dt_scan() accepts "void *", the related 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 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/c6x/kernel/setup.c b/arch/c6x/kernel/setup.c
index f016128..1d9f399 100644
--- a/arch/c6x/kernel/setup.c
+++ b/arch/c6x/kernel/setup.c
@@ -265,8 +265,8 @@ int __init c6x_add_memory(phys_addr_t start, unsigned long size)
  */
 notrace void __init machine_init(unsigned long dt_ptr)
 {
-	const void *dtb = __va(dt_ptr);
-	const void *fdt = _fdt_start;
+	void *dtb = __va(dt_ptr);
+	void *fdt = _fdt_start;
 
 	/* interrupts must be masked */
 	set_creg(IER, 2);
-- 
1.9.3

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

* Re: [PATCH v2] c6x: kernel: setup: Remove 'const' for local variables in machine_init
  2015-03-03 20:55 [PATCH v2] c6x: kernel: setup: Remove 'const' for local variables in machine_init Chen Gang
@ 2015-03-26 14:13 ` Mark Salter
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Salter @ 2015-03-26 14:13 UTC (permalink / raw)
  To: Chen Gang; +Cc: a-jacquiot, robh, linux-c6x-dev, linux-kernel

On Wed, 2015-03-04 at 04:55 +0800, Chen Gang wrote:
> early_init_dt_scan() accepts "void *", the related 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>
> ---

Thanks! I added this to the c6x tree for next merge window.

>  arch/c6x/kernel/setup.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/c6x/kernel/setup.c b/arch/c6x/kernel/setup.c
> index f016128..1d9f399 100644
> --- a/arch/c6x/kernel/setup.c
> +++ b/arch/c6x/kernel/setup.c
> @@ -265,8 +265,8 @@ int __init c6x_add_memory(phys_addr_t start, unsigned long size)
>   */
>  notrace void __init machine_init(unsigned long dt_ptr)
>  {
> -	const void *dtb = __va(dt_ptr);
> -	const void *fdt = _fdt_start;
> +	void *dtb = __va(dt_ptr);
> +	void *fdt = _fdt_start;
>  
>  	/* interrupts must be masked */
>  	set_creg(IER, 2);



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

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

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-03 20:55 [PATCH v2] c6x: kernel: setup: Remove 'const' for local variables in machine_init Chen Gang
2015-03-26 14:13 ` Mark Salter

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).