Skip to contentSkip to conversation

leds: flash: set varaiables mvflash_3,4ch_regs storage-class-specifier to static

PATCH Applied Tom Rix 3 participants 3 messages Mar 17, 2023 – Mar 30, 2023 LED

lore
Share & tools
lore

Tom Rix

author
#0 lore raw

PATCH 1/1 leds: flash: set varaiables mvflash_3,4ch_regs storage-class-specifier to static

smatch reports drivers/leds/flash/leds-qcom-flash.c:103:18: warning:
symbol 'mvflash_3ch_regs' was not declared. Should it be static?
drivers/leds/flash/leds-qcom-flash.c:115:18: warning:
symbol 'mvflash_4ch_regs' was not declared. Should it be static?

These variables are only used in leds-qcom-flash.c, so it should be static.

---
 drivers/leds/flash/leds-qcom-flash.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/leds/flash/leds-qcom-flash.c +2 -2
index 406ed8761c78..90a24fa25a49 100644
@@ -100,7 +100,7 @@ enum {
 	REG_MAX_COUNT,
 };
 
-struct reg_field mvflash_3ch_regs[REG_MAX_COUNT] = {
+static struct reg_field mvflash_3ch_regs[REG_MAX_COUNT] = {
 	REG_FIELD(0x08, 0, 7),			/* status1	*/
 	REG_FIELD(0x09, 0, 7),                  /* status2	*/
 	REG_FIELD(0x0a, 0, 7),                  /* status3	*/
@@ -112,7 +112,7 @@ struct reg_field mvflash_3ch_regs[REG_MAX_COUNT] = {
 	REG_FIELD(0x4c, 0, 2),                  /* chan_en	*/
 };
 
-struct reg_field mvflash_4ch_regs[REG_MAX_COUNT] = {
+static struct reg_field mvflash_4ch_regs[REG_MAX_COUNT] = {
 	REG_FIELD(0x06, 0, 7),			/* status1	*/
 	REG_FIELD(0x07, 0, 6),			/* status2	*/
 	REG_FIELD(0x09, 0, 7),			/* status3	*/
Signature · 1 line
2.27.0
Acked-by on v1 1/1
#1 lore raw
Quoted 10 lines · Tom Rix

smatch reports drivers/leds/flash/leds-qcom-flash.c:103:18: warning:
symbol 'mvflash_3ch_regs' was not declared. Should it be static?
drivers/leds/flash/leds-qcom-flash.c:115:18: warning:
symbol 'mvflash_4ch_regs' was not declared. Should it be static?

These variables are only used in leds-qcom-flash.c, so it should be static.

BR,
Pavel

Signature · 1 line
People of Russia, stop Putin before his war on Ukraine escalates.
maintainer Applied
#2 lore raw
In reply to Tom Rix
Quoted 6 lines · Tom Rix

smatch reports drivers/leds/flash/leds-qcom-flash.c:103:18: warning:
symbol 'mvflash_3ch_regs' was not declared. Should it be static?
drivers/leds/flash/leds-qcom-flash.c:115:18: warning:
symbol 'mvflash_4ch_regs' was not declared. Should it be static?

Quoted 7 lines

These variables are only used in leds-qcom-flash.c, so it should be static.

---
 drivers/leds/flash/leds-qcom-flash.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

I fixed-up some spelling / formatting issues and ...

Applied, thanks

--
Lee Jones [李琼斯]