From: Jonathan Cameron <jic23@kernel.org>
To: Marek Vasut <marex@denx.de>
Cc: Fabio Estevam <festevam@gmail.com>,
linux-iio@vger.kernel.org,
Fabio Estevam <fabio.estevam@freescale.com>
Subject: Re: [PATCH] iio: mxs-lradc: Fix 'duplicate const' warning
Date: Wed, 06 Feb 2013 18:37:20 +0000 [thread overview]
Message-ID: <5112A2E0.1090402@kernel.org> (raw)
In-Reply-To: <201302060359.51912.marex@denx.de>
On 02/06/2013 02:59 AM, Marek Vasut wrote:
> Dear Fabio Estevam,
>
>> From: Fabio Estevam <fabio.estevam@freescale.com>
>>
>> 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 <fabio.estevam@freescale.com>
>> ---
>> 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
next prev parent reply other threads:[~2013-02-06 18:37 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-06 2:54 [PATCH] iio: mxs-lradc: Fix 'duplicate const' warning Fabio Estevam
2013-02-06 2:59 ` Marek Vasut
2013-02-06 18:37 ` Jonathan Cameron [this message]
2013-02-09 10:52 ` Jonathan Cameron
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5112A2E0.1090402@kernel.org \
--to=jic23@kernel.org \
--cc=fabio.estevam@freescale.com \
--cc=festevam@gmail.com \
--cc=linux-iio@vger.kernel.org \
--cc=marex@denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox