netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: sfeldma@gmail.com
To: netdev@vger.kernel.org
Cc: jiri@resnulli.us, roopa@cumulusnetworks.com,
	vivien.didelot@savoirfairelinux.com, ronen.arad@intel.com,
	f.fainelli@gmail.com
Subject: [PATCH net-next 1/2] switchdev: rename vlan vid_start to vid_begin
Date: Mon, 22 Jun 2015 00:27:16 -0700	[thread overview]
Message-ID: <1434958037-26057-2-git-send-email-sfeldma@gmail.com> (raw)
In-Reply-To: <1434958037-26057-1-git-send-email-sfeldma@gmail.com>

From: Scott Feldman <sfeldma@gmail.com>

Use vid_begin/end to be consistent with BRIDGE_VLAN_INFO_RANGE_BEGIN/END.

Signed-off-by: Scott Feldman <sfeldma@gmail.com>
---
 drivers/net/ethernet/rocker/rocker.c |    4 ++--
 include/net/switchdev.h              |    2 +-
 net/bridge/br_vlan.c                 |    4 ++--
 net/switchdev/switchdev.c            |   12 ++++++------
 4 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/net/ethernet/rocker/rocker.c b/drivers/net/ethernet/rocker/rocker.c
index b72674c..76c3086 100644
--- a/drivers/net/ethernet/rocker/rocker.c
+++ b/drivers/net/ethernet/rocker/rocker.c
@@ -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)
@@ -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;
diff --git a/include/net/switchdev.h b/include/net/switchdev.h
index d882902..89da893 100644
--- a/include/net/switchdev.h
+++ b/include/net/switchdev.h
@@ -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 */
diff --git a/net/bridge/br_vlan.c b/net/bridge/br_vlan.c
index 17fc358..574feea 100644
--- a/net/bridge/br_vlan.c
+++ b/net/bridge/br_vlan.c
@@ -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,
 			},
 		};
@@ -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,
 			},
 		};
diff --git a/net/switchdev/switchdev.c b/net/switchdev/switchdev.c
index afce9cc..70764c5 100644
--- a/net/switchdev/switchdev.c
+++ b/net/switchdev/switchdev.c
@@ -511,23 +511,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)
-- 
1.7.10.4

  reply	other threads:[~2015-06-22  7:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-22  7:27 [PATCH net-next 0/2] switchdev; add VLAN support for port's bridge_getlink sfeldma
2015-06-22  7:27 ` sfeldma [this message]
2015-06-22  7:27 ` [PATCH net-next 2/2] " sfeldma
2015-06-23 13:57 ` [PATCH net-next 0/2] " David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1434958037-26057-2-git-send-email-sfeldma@gmail.com \
    --to=sfeldma@gmail.com \
    --cc=f.fainelli@gmail.com \
    --cc=jiri@resnulli.us \
    --cc=netdev@vger.kernel.org \
    --cc=ronen.arad@intel.com \
    --cc=roopa@cumulusnetworks.com \
    --cc=vivien.didelot@savoirfairelinux.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).