diff mbox series

iio: dac: set varaiable max5522_channels storage-class-specifier to static

Message ID 20230404013828.1914523-1-trix@redhat.com (mailing list archive)
State Accepted
Headers show
Series iio: dac: set varaiable max5522_channels storage-class-specifier to static | expand

Commit Message

Tom Rix April 4, 2023, 1:38 a.m. UTC
smatch reports
drivers/iio/dac/max5522.c:55:28: warning: symbol
  'max5522_channels' was not declared. Should it be static?

This variable is only used in one file so it should be static.

Signed-off-by: Tom Rix <trix@redhat.com>
---
 drivers/iio/dac/max5522.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Nuno Sá April 4, 2023, 6:43 a.m. UTC | #1
On Mon, 2023-04-03 at 21:38 -0400, Tom Rix wrote:
> smatch reports
> drivers/iio/dac/max5522.c:55:28: warning: symbol
>   'max5522_channels' was not declared. Should it be static?
> 
> This variable is only used in one file so it should be static.
> 
> Signed-off-by: Tom Rix <trix@redhat.com>
> ---

Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Jonathan Cameron April 7, 2023, 6:01 p.m. UTC | #2
On Tue, 04 Apr 2023 08:43:32 +0200
Nuno Sá <noname.nuno@gmail.com> wrote:

> On Mon, 2023-04-03 at 21:38 -0400, Tom Rix wrote:
> > smatch reports
> > drivers/iio/dac/max5522.c:55:28: warning: symbol
> >   'max5522_channels' was not declared. Should it be static?
> > 
> > This variable is only used in one file so it should be static.
> > 
> > Signed-off-by: Tom Rix <trix@redhat.com>
> > ---  
> 
> Reviewed-by: Nuno Sa <nuno.sa@analog.com>
> 
> 

Applied to the togreg branch of iio.git (pushed out initially as testing)
with tweak in patch title to fix "variable"

Thanks,

Jonathan
diff mbox series

Patch

diff --git a/drivers/iio/dac/max5522.c b/drivers/iio/dac/max5522.c
index 00ba4e98fb9c..05034a306597 100644
--- a/drivers/iio/dac/max5522.c
+++ b/drivers/iio/dac/max5522.c
@@ -52,7 +52,7 @@  struct max5522_state {
 	} \
 }
 
-const struct iio_chan_spec max5522_channels[] = {
+static const struct iio_chan_spec max5522_channels[] = {
 	MAX5522_CHANNEL(0),
 	MAX5522_CHANNEL(1),
 };