Skip to contentSkip to conversation

staging: rtl8192e: set dm_rx_path_sel_table storage-class-specifier to static

PATCH In review Tom Rix 2 participants 2 messages Feb 11, 2023 Staging

lore
Share & tools
lore

Tom Rix

author
#0 lore raw

PATCH 1/1 staging: rtl8192e: set dm_rx_path_sel_table storage-class-specifier to static

smatch reports
drivers/staging/rtl8192e/rtl8192e/rtl_dm.c:147:21:
warning: symbol 'dm_rx_path_sel_table' was not declared. Should it be static?

dm_rx_path_sel_table is only used in rtl_dm.c, so it should be static

---
 drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8192e/rtl8192e/rtl_dm.c +1 -1
index d8455b23e555..3bc5dabf2e2c 100644
@@ -144,7 +144,7 @@ const u8 dm_cck_tx_bb_gain_ch14[CCK_TX_BB_GAIN_TABLE_LEN][8] = {
 /*------------------------Define global variable-----------------------------*/
 struct dig_t dm_digtable;
 
-struct drx_path_sel dm_rx_path_sel_table;
+static struct drx_path_sel dm_rx_path_sel_table;
 /*------------------------Define global variable-----------------------------*/
 
 
Signature · 1 line
2.26.3
maintainer
#1 lore raw
Quoted 16 lines · Tom Rix

smatch reports
drivers/staging/rtl8192e/rtl8192e/rtl_dm.c:147:21:
warning: symbol 'dm_rx_path_sel_table' was not declared. Should it be static?

dm_rx_path_sel_table is only used in rtl_dm.c, so it should be static

---
 drivers/staging/rtl8192e/rtl8192e/rtl_dm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8192e/rtl8192e/rtl_dm.c +0 -0
index d8455b23e555..3bc5dabf2e2c 100644

drivers/staging/rtl8192e/rtl8192e/rtl_dm.c const u8 dm_cck_tx_bb_gain_ch14[CCK_TX_BB_GAIN_TABLE_LEN][8] = { · line 147

Quoted 5 lines
drivers/staging/rtl8192e/rtl8192e/rtl_dm.c +1 -1
@@ -144,7 +144,7 @@ const u8 dm_cck_tx_bb_gain_ch14[CCK_TX_BB_GAIN_TABLE_LEN][8] = {
 /*------------------------Define global variable-----------------------------*/
 struct dig_t dm_digtable;
 
-struct drx_path_sel dm_rx_path_sel_table;
+static struct drx_path_sel dm_rx_path_sel_table;

So now you have a local variable in the chunk that says "global variable" :(

Please always be aware of the context of the code you are changing.

thanks,

greg k-h