Skip to content

Commit

Permalink
switchdev: rename vlan vid_start to vid_begin
Browse files Browse the repository at this point in the history
Use vid_begin/end to be consistent with BRIDGE_VLAN_INFO_RANGE_BEGIN/END.

Signed-off-by: Scott Feldman <sfeldma@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Scott Feldman authored and David S. Miller committed Jun 23, 2015
1 parent e8e85cc commit 3e3a78b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions drivers/net/ethernet/rocker/rocker.c
Original file line number Diff line number Diff line change
Expand Up @@ -4295,7 +4295,7 @@ static int rocker_port_vlans_add(struct rocker_port *rocker_port,
u16 vid;
int err;

for (vid = vlan->vid_start; vid <= vlan->vid_end; vid++) {
for (vid = vlan->vid_begin; vid <= vlan->vid_end; vid++) {
err = rocker_port_vlan_add(rocker_port, trans,
vid, vlan->flags);
if (err)
Expand Down Expand Up @@ -4378,7 +4378,7 @@ static int rocker_port_vlans_del(struct rocker_port *rocker_port,
u16 vid;
int err;

for (vid = vlan->vid_start; vid <= vlan->vid_end; vid++) {
for (vid = vlan->vid_begin; vid <= vlan->vid_end; vid++) {
err = rocker_port_vlan_del(rocker_port, vid, vlan->flags);
if (err)
return err;
Expand Down
2 changes: 1 addition & 1 deletion include/net/switchdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ struct switchdev_obj {
union {
struct switchdev_obj_vlan { /* PORT_VLAN */
u16 flags;
u16 vid_start;
u16 vid_begin;
u16 vid_end;
} vlan;
struct switchdev_obj_ipv4_fib { /* IPV4_FIB */
Expand Down
4 changes: 2 additions & 2 deletions net/bridge/br_vlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ static int __vlan_vid_add(struct net_device *dev, struct net_bridge *br,
.id = SWITCHDEV_OBJ_PORT_VLAN,
.u.vlan = {
.flags = flags,
.vid_start = vid,
.vid_begin = vid,
.vid_end = vid,
},
};
Expand Down Expand Up @@ -132,7 +132,7 @@ static void __vlan_vid_del(struct net_device *dev, struct net_bridge *br,
struct switchdev_obj vlan_obj = {
.id = SWITCHDEV_OBJ_PORT_VLAN,
.u.vlan = {
.vid_start = vid,
.vid_begin = vid,
.vid_end = vid,
},
};
Expand Down
12 changes: 6 additions & 6 deletions net/switchdev/switchdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -510,23 +510,23 @@ static int switchdev_port_br_afspec(struct net_device *dev,
vinfo = nla_data(attr);
vlan->flags = vinfo->flags;
if (vinfo->flags & BRIDGE_VLAN_INFO_RANGE_BEGIN) {
if (vlan->vid_start)
if (vlan->vid_begin)
return -EINVAL;
vlan->vid_start = vinfo->vid;
vlan->vid_begin = vinfo->vid;
} else if (vinfo->flags & BRIDGE_VLAN_INFO_RANGE_END) {
if (!vlan->vid_start)
if (!vlan->vid_begin)
return -EINVAL;
vlan->vid_end = vinfo->vid;
if (vlan->vid_end <= vlan->vid_start)
if (vlan->vid_end <= vlan->vid_begin)
return -EINVAL;
err = f(dev, &obj);
if (err)
return err;
memset(vlan, 0, sizeof(*vlan));
} else {
if (vlan->vid_start)
if (vlan->vid_begin)
return -EINVAL;
vlan->vid_start = vinfo->vid;
vlan->vid_begin = vinfo->vid;
vlan->vid_end = vinfo->vid;
err = f(dev, &obj);
if (err)
Expand Down

0 comments on commit 3e3a78b

Please sign in to comment.