From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757414AbbCCRK4 (ORCPT ); Tue, 3 Mar 2015 12:10:56 -0500 Received: from mx1.redhat.com ([209.132.183.28]:59918 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756509AbbCCRKx (ORCPT ); Tue, 3 Mar 2015 12:10:53 -0500 Message-ID: <1425402645.3240.64.camel@deneb.redhat.com> Subject: Re: [PATCH] c6x: kernel: setup: Type cast 'fdt' to "void *" for early_init_dt_scan() in machine_init() From: Mark Salter To: Chen Gang <762976180@qq.com> Cc: a-jacquiot@ti.com, robh@kernel.org, "linux-c6x-dev@linux-c6x.org" , "linux-kernel@vger.kernel.org" Date: Tue, 03 Mar 2015 12:10:45 -0500 In-Reply-To: <54F2C9B1.4090403@qq.com> References: <54F2C9B1.4090403@qq.com> Organization: Red Hat, Inc Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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.