Skip to contentSkip to conversation

nvmem: change sp_otp_v0 from global to static

PATCH In review Tom Rix 2 participants 2 messages Apr 3, 2022 – Apr 29, 2022

Subsystems (2)
lore
Share & tools
lore

Tom Rix

author
#0 lore raw

PATCH 1/1 nvmem: change sp_otp_v0 from global to static

Smatch reports this issue sunplus-ocotp.c:74:29: warning: symbol 'sp_otp_v0'
was not declared. Should it be static?

sp_otp_v0 is only used in sunplus-ocotp.c. File scope variables used only in one file should be static. Change sp_otp_v0's storage-class-specifier from global to static.

---
 drivers/nvmem/sunplus-ocotp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvmem/sunplus-ocotp.c +1 -1
index 2dc59c22eb55..e0b11e13f5f8 100644
@@ -71,7 +71,7 @@ struct sp_ocotp_data {
 	int size;
 };
 
-const struct sp_ocotp_data  sp_otp_v0 = {
+static const struct sp_ocotp_data  sp_otp_v0 = {
 	.size = QAC628_OTP_SIZE,
 };
 
Signature · 1 line
2.27.0
#1 lore raw
Quoted 11 lines · Tom Rix

Smatch reports this issue sunplus-ocotp.c:74:29: warning: symbol 'sp_otp_v0'
was not declared. Should it be static?

sp_otp_v0 is only used in sunplus-ocotp.c. File scope variables used only in one file should be static. Change sp_otp_v0's storage-class-specifier from global to static.

---

There is already a patch for this in next.

--srini

Quoted 16 lines
  drivers/nvmem/sunplus-ocotp.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvmem/sunplus-ocotp.c +1 -1
index 2dc59c22eb55..e0b11e13f5f8 100644
@@ -71,7 +71,7 @@ struct sp_ocotp_data {
  	int size;
  };
 
-const struct sp_ocotp_data  sp_otp_v0 = {
+static const struct sp_ocotp_data  sp_otp_v0 = {
  	.size = QAC628_OTP_SIZE,
  };