Commit 6a112785 authored by Jacob Keller's avatar Jacob Keller Committed by Jeff Kirsher

i40e: remove second check of VLAN_N_VID in i40e_vlan_rx_add_vid

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: default avatarJacob Keller <jacob.e.keller@intel.com>
Tested-by: default avatarAndrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 7429c0bd
......@@ -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
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment