From: luo penghao <[email protected]>
This variable is not used in the function.
The clang_analyzer complains as follows:
drivers/net/ethernet/intel/e1000e/netdev.c:916:19 warning
drivers/net/ethernet/intel/e1000e/netdev.c:1310:19 warning
Value stored to 'hw' during its initialization is never read
Reported-by: Zeal Robot <[email protected]>
Signed-off-by: luo penghao <[email protected]>
---
drivers/net/ethernet/intel/e1000e/netdev.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index ebcb2a3..8a79681 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -914,7 +914,6 @@ static bool e1000_clean_rx_irq(struct e1000_ring *rx_ring, int *work_done,
struct e1000_adapter *adapter = rx_ring->adapter;
struct net_device *netdev = adapter->netdev;
struct pci_dev *pdev = adapter->pdev;
- struct e1000_hw *hw = &adapter->hw;
union e1000_rx_desc_extended *rx_desc, *next_rxd;
struct e1000_buffer *buffer_info, *next_buffer;
u32 length, staterr;
@@ -1308,7 +1307,6 @@ static bool e1000_clean_rx_irq_ps(struct e1000_ring *rx_ring, int *work_done,
int work_to_do)
{
struct e1000_adapter *adapter = rx_ring->adapter;
- struct e1000_hw *hw = &adapter->hw;
union e1000_rx_desc_packet_split *rx_desc, *next_rxd;
struct net_device *netdev = adapter->netdev;
struct pci_dev *pdev = adapter->pdev;
--
2.15.2
On Thu, 2021-11-11 at 09:07 +0000, [email protected] wrote:
> From: luo penghao <[email protected]>
>
> This variable is not used in the function.
>
> The clang_analyzer complains as follows:
>
> drivers/net/ethernet/intel/e1000e/netdev.c:916:19 warning
> drivers/net/ethernet/intel/e1000e/netdev.c:1310:19 warning
>
> Value stored to 'hw' during its initialization is never read
This patch also doesn't build:
In file included from ./include/linux/printk.h:555,
from ./include/linux/kernel.h:20,
from ./arch/x86/include/asm/percpu.h:27,
from ./arch/x86/include/asm/current.h:6,
from ./arch/x86/include/asm/processor.h:17,
from ./arch/x86/include/asm/timex.h:5,
from ./include/linux/timex.h:65,
from ./include/linux/time32.h:13,
from ./include/linux/time.h:60,
from ./include/linux/stat.h:19,
from ./include/linux/module.h:13,
from drivers/net/ethernet/intel/e1000e/netdev.c:6:
drivers/net/ethernet/intel/e1000e/netdev.c: In function
e1000_clean_rx_irq:
drivers/net/ethernet/intel/e1000e/e1000.h:31:20: error: hw undeclared
(first use in this function)
31 | netdev_dbg(hw->adapter->netdev, format, ## arg)
| ^~
./include/linux/dynamic_debug.h:134:29: note: in definition of macro
__dynamic_func_call
134 | func(&id, ##__VA_ARGS__); \
| ^~~~~~~~~~~
./include/linux/dynamic_debug.h:170:9: note: in expansion of macro
_dynamic_func_call
170 | _dynamic_func_call(fmt, __dynamic_netdev_dbg,
\
| ^~~~~~~~~~~~~~~~~~
./include/linux/netdevice.h:4950:9: note: in expansion of macro
dynamic_netdev_dbg
4950 | dynamic_netdev_dbg(__dev, format, ##args);
\
| ^~~~~~~~~~~~~~~~~~
drivers/net/ethernet/intel/e1000e/e1000.h:31:9: note: in expansion of
macro netdev_dbg
31 | netdev_dbg(hw->adapter->netdev, format, ## arg)
| ^~~~~~~~~~
drivers/net/ethernet/intel/e1000e/netdev.c:970:25: note: in expansion
of macro e_dbg
970 | e_dbg("Receive packet consumed multiple
buffers\n");
| ^~~~~
drivers/net/ethernet/intel/e1000e/e1000.h:31:20: note: each undeclared
identifier is reported only once for each function it appears in
31 | netdev_dbg(hw->adapter->netdev, format, ## arg)
| ^~
./include/linux/dynamic_debug.h:134:29: note: in definition of macro
__dynamic_func_call
134 | func(&id, ##__VA_ARGS__); \
| ^~~~~~~~~~~
./include/linux/dynamic_debug.h:170:9: note: in expansion of macro
_dynamic_func_call
170 | _dynamic_func_call(fmt, __dynamic_netdev_dbg,
\
| ^~~~~~~~~~~~~~~~~~
./include/linux/netdevice.h:4950:9: note: in expansion of macro
dynamic_netdev_dbg
4950 | dynamic_netdev_dbg(__dev, format, ##args);
\
| ^~~~~~~~~~~~~~~~~~
drivers/net/ethernet/intel/e1000e/e1000.h:31:9: note: in expansion of
macro netdev_dbg
31 | netdev_dbg(hw->adapter->netdev, format, ## arg)
| ^~~~~~~~~~
drivers/net/ethernet/intel/e1000e/netdev.c:970:25: note: in expansion
of macro e_dbg
970 | e_dbg("Receive packet consumed multiple
buffers\n");
| ^~~~~
drivers/net/ethernet/intel/e1000e/netdev.c: In function
e1000_clean_rx_irq_ps:
drivers/net/ethernet/intel/e1000e/e1000.h:31:20: error: hw undeclared
(first use in this function)
31 | netdev_dbg(hw->adapter->netdev, format, ## arg)
| ^~
./include/linux/dynamic_debug.h:134:29: note: in definition of macro
__dynamic_func_call
134 | func(&id, ##__VA_ARGS__); \
| ^~~~~~~~~~~
./include/linux/dynamic_debug.h:170:9: note: in expansion of macro
_dynamic_func_call
170 | _dynamic_func_call(fmt, __dynamic_netdev_dbg,
\
| ^~~~~~~~~~~~~~~~~~
./include/linux/netdevice.h:4950:9: note: in expansion of macro
dynamic_netdev_dbg
4950 | dynamic_netdev_dbg(__dev, format, ##args);
\
| ^~~~~~~~~~~~~~~~~~
drivers/net/ethernet/intel/e1000e/e1000.h:31:9: note: in expansion of
macro netdev_dbg
31 | netdev_dbg(hw->adapter->netdev, format, ## arg)
| ^~~~~~~~~~
drivers/net/ethernet/intel/e1000e/netdev.c:1356:25: note: in expansion
of macro e_dbg
1356 | e_dbg("Packet Split buffers didn't pick
up the full packet\n");
| ^~~~~