Skip to contentSkip to conversation

nvmem: layouts: sl28vpd: set varaiable sl28vpd_layout storage-class-specifier to static

PATCH In review Tom Rix 2 participants 3 messages Apr 4, 2023 – Apr 5, 2023

Subsystems (2)
lore
Share & tools
lore

Tom Rix

author
#0 lore raw

PATCH 1/1 nvmem: layouts: sl28vpd: set varaiable sl28vpd_layout storage-class-specifier to static

smatch reports drivers/nvmem/layouts/sl28vpd.c:144:21: warning: symbol
'sl28vpd_layout' was not declared. Should it be static?

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

---
 drivers/nvmem/layouts/sl28vpd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvmem/layouts/sl28vpd.c +1 -1
index 9cc1715c2fd5..05671371f631 100644
@@ -141,7 +141,7 @@ static const struct of_device_id sl28vpd_of_match_table[] = {
 };
 MODULE_DEVICE_TABLE(of, sl28vpd_of_match_table);
 
-struct nvmem_layout sl28vpd_layout = {
+static struct nvmem_layout sl28vpd_layout = {
 	.name = "sl28-vpd",
 	.of_match_table = sl28vpd_of_match_table,
 	.add_cells = sl28vpd_add_cells,
Signature · 1 line
2.27.0
author
#2 lore raw
Quoted 11 lines · Michael Walle

Am 2023-04-04 18:36, schrieb Tom Rix:

Quoted 7 lines

smatch reports drivers/nvmem/layouts/sl28vpd.c:144:21: warning: symbol 'sl28vpd_layout' was not declared. Should it be static?

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

Fixes tag?

I am cleaning all of the similar reports by smatch, there is a couple hundred.

Because the code works as-is, I do not consider them broken and needing fixes tags.

However I do not mind adding then if they are required.

Tom

Quoted 4 lines

-michael