From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from saturn.retrosnub.co.uk ([178.18.118.26]:39243 "EHLO saturn.retrosnub.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755382Ab3BFShX (ORCPT ); Wed, 6 Feb 2013 13:37:23 -0500 Message-ID: <5112A2E0.1090402@kernel.org> Date: Wed, 06 Feb 2013 18:37:20 +0000 From: Jonathan Cameron MIME-Version: 1.0 To: Marek Vasut CC: Fabio Estevam , linux-iio@vger.kernel.org, Fabio Estevam Subject: Re: [PATCH] iio: mxs-lradc: Fix 'duplicate const' warning References: <1360119284-28726-1-git-send-email-festevam@gmail.com> <201302060359.51912.marex@denx.de> In-Reply-To: <201302060359.51912.marex@denx.de> Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-iio-owner@vger.kernel.org List-Id: linux-iio@vger.kernel.org On 02/06/2013 02:59 AM, Marek Vasut wrote: > Dear Fabio Estevam, > >> From: Fabio Estevam >> >> The following warning is generated by sparse: >> >> drivers/staging/iio/adc/mxs-lradc.c:118:47: warning: duplicate const >> >> Remove the duplicate const. >> >> Signed-off-by: Fabio Estevam >> --- >> drivers/staging/iio/adc/mxs-lradc.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/staging/iio/adc/mxs-lradc.c >> b/drivers/staging/iio/adc/mxs-lradc.c index 33a2747..55a459b 100644 >> --- a/drivers/staging/iio/adc/mxs-lradc.c >> +++ b/drivers/staging/iio/adc/mxs-lradc.c >> @@ -115,7 +115,7 @@ struct mxs_lradc_of_config { >> const char * const *irq_name; >> }; >> >> -static const struct mxs_lradc_of_config const mxs_lradc_of_config[] = { >> +static const struct mxs_lradc_of_config mxs_lradc_of_config[] = { >> [IMX23_LRADC] = { >> .irq_count = ARRAY_SIZE(mx23_lradc_irq_names), >> .irq_name = mx23_lradc_irq_names, > > Isn't it const variable/array const array elements ... thus correct with the two > consts ? Sadly not. c99 c.7.3.8 (first sentence) or c11 c.7.3.9 If the specification of an array type includes any type qualifiers, the element type is so- qualified, not the array type. I think that covers it though I'll admit I'm never that good at following these specs and got the reference from googling. Jonathan