* [PATCH] iio: mxs-lradc: Fix 'duplicate const' warning
@ 2013-02-06 2:54 Fabio Estevam
2013-02-06 2:59 ` Marek Vasut
0 siblings, 1 reply; 4+ messages in thread
From: Fabio Estevam @ 2013-02-06 2:54 UTC (permalink / raw)
To: jic23; +Cc: marex, linux-iio, 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,
--
1.7.9.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] iio: mxs-lradc: Fix 'duplicate const' warning
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
0 siblings, 1 reply; 4+ messages in thread
From: Marek Vasut @ 2013-02-06 2:59 UTC (permalink / raw)
To: Fabio Estevam; +Cc: jic23, linux-iio, Fabio Estevam
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 ?
Best regards,
Marek Vasut
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] iio: mxs-lradc: Fix 'duplicate const' warning
2013-02-06 2:59 ` Marek Vasut
@ 2013-02-06 18:37 ` Jonathan Cameron
2013-02-09 10:52 ` Jonathan Cameron
0 siblings, 1 reply; 4+ messages in thread
From: Jonathan Cameron @ 2013-02-06 18:37 UTC (permalink / raw)
To: Marek Vasut; +Cc: Fabio Estevam, linux-iio, Fabio Estevam
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] iio: mxs-lradc: Fix 'duplicate const' warning
2013-02-06 18:37 ` Jonathan Cameron
@ 2013-02-09 10:52 ` Jonathan Cameron
0 siblings, 0 replies; 4+ messages in thread
From: Jonathan Cameron @ 2013-02-09 10:52 UTC (permalink / raw)
To: Marek Vasut; +Cc: Fabio Estevam, linux-iio, Fabio Estevam
On 02/06/2013 06:37 PM, Jonathan Cameron wrote:
> 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>
applied to togreg branch of iio.git. Thanks,
Jonathan
>>> ---
>>> 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
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-02-09 10:52 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2013-02-09 10:52 ` Jonathan Cameron
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.