[PATCH 1/2] iio: adc: ad7380: make ad7380_regmap_config static

David Lechner posted 2 patches 1 year, 10 months ago
There is a newer version of this series
[PATCH 1/2] iio: adc: ad7380: make ad7380_regmap_config static
Posted by David Lechner 1 year, 10 months ago
ad7380_regmap_config is not used outside of ad7380.c, so make it static.

Fixes sparse warning:

     drivers/iio/adc/ad7380.c:205:28: sparse: sparse: symbol
     'ad7380_regmap_config' was not declared. Should it be static?

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202401280629.5kknB57C-lkp@intel.com/
Signed-off-by: David Lechner <dlechner@baylibre.com>
---
 drivers/iio/adc/ad7380.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/adc/ad7380.c b/drivers/iio/adc/ad7380.c
index 80712aaa9548..44b8b18ab213 100644
--- a/drivers/iio/adc/ad7380.c
+++ b/drivers/iio/adc/ad7380.c
@@ -202,7 +202,7 @@ static int ad7380_regmap_reg_read(void *context, unsigned int reg,
 	return 0;
 }
 
-const struct regmap_config ad7380_regmap_config = {
+static const struct regmap_config ad7380_regmap_config = {
 	.reg_bits = 3,
 	.val_bits = 12,
 	.reg_read = ad7380_regmap_reg_read,
-- 
2.43.0
Re: [PATCH 1/2] iio: adc: ad7380: make ad7380_regmap_config static
Posted by Jonathan Cameron 1 year, 10 months ago
On Mon, 29 Jan 2024 11:41:49 -0600
David Lechner <dlechner@baylibre.com> wrote:

> ad7380_regmap_config is not used outside of ad7380.c, so make it static.
> 
> Fixes sparse warning:
> 
>      drivers/iio/adc/ad7380.c:205:28: sparse: sparse: symbol
>      'ad7380_regmap_config' was not declared. Should it be static?
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202401280629.5kknB57C-lkp@intel.com/
> Signed-off-by: David Lechner <dlechner@baylibre.com>

I saw the report of this one and squished it in the original patch.

The second one I decide was a false positive so could wait a bit longer.
Still nice to get rid of that warning though.

> ---
>  drivers/iio/adc/ad7380.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/adc/ad7380.c b/drivers/iio/adc/ad7380.c
> index 80712aaa9548..44b8b18ab213 100644
> --- a/drivers/iio/adc/ad7380.c
> +++ b/drivers/iio/adc/ad7380.c
> @@ -202,7 +202,7 @@ static int ad7380_regmap_reg_read(void *context, unsigned int reg,
>  	return 0;
>  }
>  
> -const struct regmap_config ad7380_regmap_config = {
> +static const struct regmap_config ad7380_regmap_config = {
>  	.reg_bits = 3,
>  	.val_bits = 12,
>  	.reg_read = ad7380_regmap_reg_read,