Skip to contentSkip to conversation

nvmem: imx-ocotp: set varaiable imx_ocotp_layout storage-class-specifier to static

PATCH In review Tom Rix 2 participants 2 messages Apr 4, 2023 – May 9, 2023

Subsystems (2)
lore
Share & tools
lore

Tom Rix

author
#0 lore raw

PATCH 1/1 nvmem: imx-ocotp: set varaiable imx_ocotp_layout storage-class-specifier to static

smatch reports
drivers/nvmem/imx-ocotp.c:599:21: warning: symbol
'imx_ocotp_layout' was not declared. Should it be static?

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

---
 drivers/nvmem/imx-ocotp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvmem/imx-ocotp.c +1 -1
index ac0edb6398f1..fcea9c04be96 100644
@@ -596,7 +596,7 @@ static void imx_ocotp_fixup_cell_info(struct nvmem_device *nvmem,
 	cell->read_post_process = imx_ocotp_cell_pp;
 }
 
-struct nvmem_layout imx_ocotp_layout = {
+static struct nvmem_layout imx_ocotp_layout = {
 	.fixup_cell_info = imx_ocotp_fixup_cell_info,
 };
 
Signature · 7 lines
2.27.0


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#1 lore raw
Quoted 8 lines · Tom Rix

smatch reports
drivers/nvmem/imx-ocotp.c:599:21: warning: symbol
'imx_ocotp_layout' was not declared. Should it be static?

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

---

Applied thanks,

--srini

Quoted 16 lines
  drivers/nvmem/imx-ocotp.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvmem/imx-ocotp.c +1 -1
index ac0edb6398f1..fcea9c04be96 100644
@@ -596,7 +596,7 @@ static void imx_ocotp_fixup_cell_info(struct nvmem_device *nvmem,
  	cell->read_post_process = imx_ocotp_cell_pp;
  }
 
-struct nvmem_layout imx_ocotp_layout = {
+static struct nvmem_layout imx_ocotp_layout = {
  	.fixup_cell_info = imx_ocotp_fixup_cell_info,
  };