diff mbox

iio: adc: xilinx: constify iio_buffer_setup_ops structure

Message ID 1447617602-12922-1-git-send-email-Julia.Lawall@lip6.fr (mailing list archive)
State New, archived
Headers show

Commit Message

Julia Lawall Nov. 15, 2015, 8 p.m. UTC
The iio_buffer_setup_ops structures are never modified, so declare this one
as const, like the others.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 drivers/iio/adc/xilinx-xadc-core.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Lars-Peter Clausen Nov. 15, 2015, 8:19 p.m. UTC | #1
On 11/15/2015 09:00 PM, Julia Lawall wrote:
> The iio_buffer_setup_ops structures are never modified, so declare this one
> as const, like the others.
> 
> Done with the help of Coccinelle.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Acked-by: Lars-Peter Clausen <lars@metafoo.de>

Thanks.

> 
> ---
>  drivers/iio/adc/xilinx-xadc-core.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/adc/xilinx-xadc-core.c b/drivers/iio/adc/xilinx-xadc-core.c
> index 0370624..c2b5f10 100644
> --- a/drivers/iio/adc/xilinx-xadc-core.c
> +++ b/drivers/iio/adc/xilinx-xadc-core.c
> @@ -803,7 +803,7 @@ err:
>  	return ret;
>  }
>  
> -static struct iio_buffer_setup_ops xadc_buffer_ops = {
> +static const struct iio_buffer_setup_ops xadc_buffer_ops = {
>  	.preenable = &xadc_preenable,
>  	.postenable = &iio_triggered_buffer_postenable,
>  	.predisable = &iio_triggered_buffer_predisable,
>
Jonathan Cameron Nov. 18, 2015, 7:04 p.m. UTC | #2
On 15/11/15 20:19, Lars-Peter Clausen wrote:
> On 11/15/2015 09:00 PM, Julia Lawall wrote:
>> The iio_buffer_setup_ops structures are never modified, so declare this one
>> as const, like the others.
>>
>> Done with the help of Coccinelle.
>>
>> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
> 
> Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Applied.

Thanks,

Jonathan
> 
> Thanks.
> 
>>
>> ---
>>  drivers/iio/adc/xilinx-xadc-core.c |    2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/iio/adc/xilinx-xadc-core.c b/drivers/iio/adc/xilinx-xadc-core.c
>> index 0370624..c2b5f10 100644
>> --- a/drivers/iio/adc/xilinx-xadc-core.c
>> +++ b/drivers/iio/adc/xilinx-xadc-core.c
>> @@ -803,7 +803,7 @@ err:
>>  	return ret;
>>  }
>>  
>> -static struct iio_buffer_setup_ops xadc_buffer_ops = {
>> +static const struct iio_buffer_setup_ops xadc_buffer_ops = {
>>  	.preenable = &xadc_preenable,
>>  	.postenable = &iio_triggered_buffer_postenable,
>>  	.predisable = &iio_triggered_buffer_predisable,
>>
>
diff mbox

Patch

diff --git a/drivers/iio/adc/xilinx-xadc-core.c b/drivers/iio/adc/xilinx-xadc-core.c
index 0370624..c2b5f10 100644
--- a/drivers/iio/adc/xilinx-xadc-core.c
+++ b/drivers/iio/adc/xilinx-xadc-core.c
@@ -803,7 +803,7 @@  err:
 	return ret;
 }
 
-static struct iio_buffer_setup_ops xadc_buffer_ops = {
+static const struct iio_buffer_setup_ops xadc_buffer_ops = {
 	.preenable = &xadc_preenable,
 	.postenable = &iio_triggered_buffer_postenable,
 	.predisable = &iio_triggered_buffer_predisable,