diff mbox

[v3,1/3] iio: adc: meson-saradc: mark all meson_sar_adc_data static and const

Message ID 20170504180136.27025-2-martin.blumenstingl@googlemail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Martin Blumenstingl May 4, 2017, 6:01 p.m. UTC
These are only passed as of_device_id.data and never modified. Thus we
can mark them as static const, just like the of_device_id instances
where they are used.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
---
 drivers/iio/adc/meson_saradc.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Langer, Thomas May 4, 2017, 7:07 p.m. UTC | #1
Hello Martin,

> 
> These are only passed as of_device_id.data and never modified. Thus we
> can mark them as static const, just like the of_device_id instances
> where they are used.

Here you talk about static const, but in the code below the const is missing.

> 
> Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
> ---
>  drivers/iio/adc/meson_saradc.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/iio/adc/meson_saradc.c
> b/drivers/iio/adc/meson_saradc.c
> index dd4190b50df6..1cb5df306001 100644
> --- a/drivers/iio/adc/meson_saradc.c
> +++ b/drivers/iio/adc/meson_saradc.c
> @@ -834,17 +834,17 @@ static const struct iio_info meson_sar_adc_iio_info
> = {
>  	.driver_module = THIS_MODULE,
>  };
> 
> -struct meson_sar_adc_data meson_sar_adc_gxbb_data = {
> +static struct meson_sar_adc_data meson_sar_adc_gxbb_data = {
>  	.resolution = 10,
>  	.name = "meson-gxbb-saradc",
>  };
> 
> -struct meson_sar_adc_data meson_sar_adc_gxl_data = {
> +static struct meson_sar_adc_data meson_sar_adc_gxl_data = {
>  	.resolution = 12,
>  	.name = "meson-gxl-saradc",
>  };
> 
> -struct meson_sar_adc_data meson_sar_adc_gxm_data = {
> +static struct meson_sar_adc_data meson_sar_adc_gxm_data = {
>  	.resolution = 12,
>  	.name = "meson-gxm-saradc",
>  };
> --
> 2.12.2
>
Martin Blumenstingl May 5, 2017, 9:17 p.m. UTC | #2
Hi Thomas,

On Thu, May 4, 2017 at 9:07 PM, Langer, Thomas <thomas.langer@intel.com> wrote:
> Hello Martin,
>
>>
>> These are only passed as of_device_id.data and never modified. Thus we
>> can mark them as static const, just like the of_device_id instances
>> where they are used.
>
> Here you talk about static const, but in the code below the const is missing.
indeed - excellent catch, thank you! I'll fix this in v4

>>
>> Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
>> ---
>>  drivers/iio/adc/meson_saradc.c | 6 +++---
>>  1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/iio/adc/meson_saradc.c
>> b/drivers/iio/adc/meson_saradc.c
>> index dd4190b50df6..1cb5df306001 100644
>> --- a/drivers/iio/adc/meson_saradc.c
>> +++ b/drivers/iio/adc/meson_saradc.c
>> @@ -834,17 +834,17 @@ static const struct iio_info meson_sar_adc_iio_info
>> = {
>>       .driver_module = THIS_MODULE,
>>  };
>>
>> -struct meson_sar_adc_data meson_sar_adc_gxbb_data = {
>> +static struct meson_sar_adc_data meson_sar_adc_gxbb_data = {
>>       .resolution = 10,
>>       .name = "meson-gxbb-saradc",
>>  };
>>
>> -struct meson_sar_adc_data meson_sar_adc_gxl_data = {
>> +static struct meson_sar_adc_data meson_sar_adc_gxl_data = {
>>       .resolution = 12,
>>       .name = "meson-gxl-saradc",
>>  };
>>
>> -struct meson_sar_adc_data meson_sar_adc_gxm_data = {
>> +static struct meson_sar_adc_data meson_sar_adc_gxm_data = {
>>       .resolution = 12,
>>       .name = "meson-gxm-saradc",
>>  };
>> --
>> 2.12.2
>>
>
diff mbox

Patch

diff --git a/drivers/iio/adc/meson_saradc.c b/drivers/iio/adc/meson_saradc.c
index dd4190b50df6..1cb5df306001 100644
--- a/drivers/iio/adc/meson_saradc.c
+++ b/drivers/iio/adc/meson_saradc.c
@@ -834,17 +834,17 @@  static const struct iio_info meson_sar_adc_iio_info = {
 	.driver_module = THIS_MODULE,
 };
 
-struct meson_sar_adc_data meson_sar_adc_gxbb_data = {
+static struct meson_sar_adc_data meson_sar_adc_gxbb_data = {
 	.resolution = 10,
 	.name = "meson-gxbb-saradc",
 };
 
-struct meson_sar_adc_data meson_sar_adc_gxl_data = {
+static struct meson_sar_adc_data meson_sar_adc_gxl_data = {
 	.resolution = 12,
 	.name = "meson-gxl-saradc",
 };
 
-struct meson_sar_adc_data meson_sar_adc_gxm_data = {
+static struct meson_sar_adc_data meson_sar_adc_gxm_data = {
 	.resolution = 12,
 	.name = "meson-gxm-saradc",
 };