Skip to contentSkip to conversation

e1000e: add ifdef to avoid dead code

PATCH In review Greg Thelen 3 participants 3 messages Jun 14, 2020 – Jun 16, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 e1000e: add ifdef to avoid dead code

Commit e086ba2fccda ("e1000e: disable s0ix entry and exit flows for ME
systems") added e1000e_check_me() but it's only called from
CONFIG_PM_SLEEP protected code. Thus builds without CONFIG_PM_SLEEP
see:
drivers/net/ethernet/intel/e1000e/netdev.c:137:13: warning: 'e1000e_check_me' defined but not used [-Wunused-function]

Add CONFIG_PM_SLEEP ifdef guard to avoid dead code.

Fixes e086ba2fccda ("e1000e: disable s0ix entry and exit flows for ME systems")
---
 drivers/net/ethernet/intel/e1000e/netdev.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/ethernet/intel/e1000e/netdev.c +2 -0
index a279f4fa9962..165f0aea22c9 100644
@@ -107,6 +107,7 @@ static const struct e1000_reg_info e1000_reg_info_tbl[] = {
 	{0, NULL}
 };
 
+#ifdef CONFIG_PM_SLEEP
 struct e1000e_me_supported {
 	u16 device_id;		/* supported device ID */
 };
@@ -145,6 +146,7 @@ static bool e1000e_check_me(u16 device_id)
 
 	return false;
 }
+#endif /* CONFIG_PM_SLEEP */
 
 /**
  * __ew32_prepare - prepare to write to MAC CSR register on certain parts
Signature · 1 line
2.27.0.290.gba653c62da-goog
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Greg Thelen

Commit e086ba2fccda ("e1000e: disable s0ix entry and exit flows for ME
systems") added e1000e_check_me() but it's only called from
CONFIG_PM_SLEEP protected code. Thus builds without CONFIG_PM_SLEEP
see:
drivers/net/ethernet/intel/e1000e/netdev.c:137:13: warning: 'e1000e_check_me' defined but not used [-Wunused-function]

Quoted 7 lines

Add CONFIG_PM_SLEEP ifdef guard to avoid dead code.

Fixes e086ba2fccda ("e1000e: disable s0ix entry and exit flows for ME systems")
---
 drivers/net/ethernet/intel/e1000e/netdev.c | 2 ++
 1 file changed, 2 insertions(+)

Thanks Greg

#2 lore raw
Quoted 12 lines

-----Original Message-----
From: Eric Dumazet <[email protected]>

Quoted 9 lines · Greg Thelen

Commit e086ba2fccda ("e1000e: disable s0ix entry and exit flows for ME systems") added e1000e_check_me() but it's only called from CONFIG_PM_SLEEP protected code. Thus builds without CONFIG_PM_SLEEP see:
drivers/net/ethernet/intel/e1000e/netdev.c:137:13: warning:
'e1000e_check_me' defined but not used [-Wunused-function]

Add CONFIG_PM_SLEEP ifdef guard to avoid dead code.

Quoted 8 lines
Quoted 6 lines
Fixes e086ba2fccda ("e1000e: disable s0ix entry and exit flows for ME

systems")

---
 drivers/net/ethernet/intel/e1000e/netdev.c | 2 ++
 1 file changed, 2 insertions(+)

[Kirsher, Jeffrey T]

This patch is not necessary, after Arnd's patch. Here is his patch:
http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20200527134716.948148-1-arnd at arndb.de/
and I will be pushing it to Dave's net tree later tonight.