Skip to content

Commit

Permalink
i40e: remove second check of VLAN_N_VID in i40e_vlan_rx_add_vid
Browse files Browse the repository at this point in the history
Replace a check of magic number 4095 with VLAN_N_VID. This
makes it obvious that a later check against VLAN_N_VID is
always true and can be removed.

Change-ID: I28998f127a61a529480ce63d8a07e266f6c63b7b
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
  • Loading branch information
Jacob Keller authored and Jeff Kirsher committed Dec 3, 2016
1 parent 7429c0b commit 6a11278
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/ethernet/intel/i40e/i40e_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2549,7 +2549,7 @@ static int i40e_vlan_rx_add_vid(struct net_device *netdev,
struct i40e_vsi *vsi = np->vsi;
int ret = 0;

if (vid > 4095)
if (vid >= VLAN_N_VID)
return -EINVAL;

/* If the network stack called us with vid = 0 then
Expand All @@ -2561,7 +2561,7 @@ static int i40e_vlan_rx_add_vid(struct net_device *netdev,
if (vid)
ret = i40e_vsi_add_vlan(vsi, vid);

if (!ret && (vid < VLAN_N_VID))
if (!ret)
set_bit(vid, vsi->active_vlans);

return ret;
Expand Down

0 comments on commit 6a11278

Please sign in to comment.