[14/19] fm10k: remove needless initialization of size local variable
diff mbox series

Message ID 20190708231236.20516-15-jacob.e.keller@intel.com
State Accepted
Delegated to: Jeff Kirsher
Headers show
Series
  • cleanup cppcheck warnings for fm10k driver
Related show

Commit Message

Jacob Keller July 8, 2019, 11:12 p.m. UTC
The local variable 'size' in fm10k_dfwd_add_station is initialized, but
is always re-assigned immediately before use. Remove this unnecessary
initialization.

This was detected by cppcheck and resolves the following warning
produced by that tool:

[fm10k_netdev.c:1466]: (style) Variable 'size' is assigned a value that is never used.

Change-Id: I6f6d1ba3b9b26c2ed6f434fbeeafbbda4b78db33
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Title: fm10k: remove needless initialization of size local variable
Change-type: ImplementationChange
---
 drivers/net/ethernet/intel/fm10k/fm10k_netdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Bowers, AndrewX July 12, 2019, 6:06 p.m. UTC | #1
> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces@osuosl.org] On
> Behalf Of Jacob Keller
> Sent: Monday, July 8, 2019 4:13 PM
> To: Intel Wired LAN <intel-wired-lan@lists.osuosl.org>
> Subject: [Intel-wired-lan] [PATCH 14/19] fm10k: remove needless
> initialization of size local variable
> 
> The local variable 'size' in fm10k_dfwd_add_station is initialized, but is always
> re-assigned immediately before use. Remove this unnecessary initialization.
> 
> This was detected by cppcheck and resolves the following warning produced
> by that tool:
> 
> [fm10k_netdev.c:1466]: (style) Variable 'size' is assigned a value that is never
> used.
> 
> Change-Id: I6f6d1ba3b9b26c2ed6f434fbeeafbbda4b78db33
> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
> Title: fm10k: remove needless initialization of size local variable
> Change-type: ImplementationChange
> ---
>  drivers/net/ethernet/intel/fm10k/fm10k_netdev.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Tested-by: Andrew Bowers <andrewx.bowers@intel.com>

Patch
diff mbox series

diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c b/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c
index 4704395c0f66..d3e85480f46d 100644
--- a/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c
+++ b/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c
@@ -1463,7 +1463,7 @@  static void *fm10k_dfwd_add_station(struct net_device *dev,
 	struct fm10k_l2_accel *old_l2_accel = NULL;
 	struct fm10k_dglort_cfg dglort = { 0 };
 	struct fm10k_hw *hw = &interface->hw;
-	int size = 0, i;
+	int size, i;
 	u16 vid, glort;
 
 	/* The hardware supported by fm10k only filters on the destination MAC