aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVivien Didelot <vivien.didelot@savoirfairelinux.com>2017-11-30 11:23:57 -0500
committerDavid S. Miller <davem@davemloft.net>2017-12-02 21:18:55 -0500
commit80e023607982faa6245507c45acf93bb0feb0ded (patch)
tree93ae3c0910598e5b73bccdeb9121bf771605ccdf
parent183dea5818315c0a172d21ecbcd2554894bf01e3 (diff)
net: dsa: remove trans argument from vlan ops
The DSA switch VLAN ops pass the switchdev_trans structure down to the drivers, but no one is using them and they aren't supposed to anyway. Remove the trans argument from VLAN prepare and add operations. At the same time, fix the following checkpatch warning: WARNING: line over 80 characters #74: FILE: drivers/net/dsa/dsa_loop.c:177: + const struct switchdev_obj_port_vlan *vlan) Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/dsa/b53/b53_common.c6
-rw-r--r--drivers/net/dsa/b53/b53_priv.h6
-rw-r--r--drivers/net/dsa/dsa_loop.c9
-rw-r--r--drivers/net/dsa/microchip/ksz_common.c6
-rw-r--r--drivers/net/dsa/mv88e6xxx/chip.c6
-rw-r--r--include/net/dsa.h10
-rw-r--r--net/dsa/switch.c4
7 files changed, 18 insertions, 29 deletions
diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c
index 7f26f5dafca7..561b05089cb6 100644
--- a/drivers/net/dsa/b53/b53_common.c
+++ b/drivers/net/dsa/b53/b53_common.c
@@ -1029,8 +1029,7 @@ int b53_vlan_filtering(struct dsa_switch *ds, int port, bool vlan_filtering)
1029EXPORT_SYMBOL(b53_vlan_filtering); 1029EXPORT_SYMBOL(b53_vlan_filtering);
1030 1030
1031int b53_vlan_prepare(struct dsa_switch *ds, int port, 1031int b53_vlan_prepare(struct dsa_switch *ds, int port,
1032 const struct switchdev_obj_port_vlan *vlan, 1032 const struct switchdev_obj_port_vlan *vlan)
1033 struct switchdev_trans *trans)
1034{ 1033{
1035 struct b53_device *dev = ds->priv; 1034 struct b53_device *dev = ds->priv;
1036 1035
@@ -1047,8 +1046,7 @@ int b53_vlan_prepare(struct dsa_switch *ds, int port,
1047EXPORT_SYMBOL(b53_vlan_prepare); 1046EXPORT_SYMBOL(b53_vlan_prepare);
1048 1047
1049void b53_vlan_add(struct dsa_switch *ds, int port, 1048void b53_vlan_add(struct dsa_switch *ds, int port,
1050 const struct switchdev_obj_port_vlan *vlan, 1049 const struct switchdev_obj_port_vlan *vlan)
1051 struct switchdev_trans *trans)
1052{ 1050{
1053 struct b53_device *dev = ds->priv; 1051 struct b53_device *dev = ds->priv;
1054 bool untagged = vlan->flags & BRIDGE_VLAN_INFO_UNTAGGED; 1052 bool untagged = vlan->flags & BRIDGE_VLAN_INFO_UNTAGGED;
diff --git a/drivers/net/dsa/b53/b53_priv.h b/drivers/net/dsa/b53/b53_priv.h
index 2af0155efce2..d954cf36ecd8 100644
--- a/drivers/net/dsa/b53/b53_priv.h
+++ b/drivers/net/dsa/b53/b53_priv.h
@@ -295,11 +295,9 @@ void b53_br_set_stp_state(struct dsa_switch *ds, int port, u8 state);
295void b53_br_fast_age(struct dsa_switch *ds, int port); 295void b53_br_fast_age(struct dsa_switch *ds, int port);
296int b53_vlan_filtering(struct dsa_switch *ds, int port, bool vlan_filtering); 296int b53_vlan_filtering(struct dsa_switch *ds, int port, bool vlan_filtering);
297int b53_vlan_prepare(struct dsa_switch *ds, int port, 297int b53_vlan_prepare(struct dsa_switch *ds, int port,
298 const struct switchdev_obj_port_vlan *vlan, 298 const struct switchdev_obj_port_vlan *vlan);
299 struct switchdev_trans *trans);
300void b53_vlan_add(struct dsa_switch *ds, int port, 299void b53_vlan_add(struct dsa_switch *ds, int port,
301 const struct switchdev_obj_port_vlan *vlan, 300 const struct switchdev_obj_port_vlan *vlan);
302 struct switchdev_trans *trans);
303int b53_vlan_del(struct dsa_switch *ds, int port, 301int b53_vlan_del(struct dsa_switch *ds, int port,
304 const struct switchdev_obj_port_vlan *vlan); 302 const struct switchdev_obj_port_vlan *vlan);
305int b53_fdb_add(struct dsa_switch *ds, int port, 303int b53_fdb_add(struct dsa_switch *ds, int port,
diff --git a/drivers/net/dsa/dsa_loop.c b/drivers/net/dsa/dsa_loop.c
index bb71d3d6f65b..7aa84ee4e771 100644
--- a/drivers/net/dsa/dsa_loop.c
+++ b/drivers/net/dsa/dsa_loop.c
@@ -174,9 +174,9 @@ static int dsa_loop_port_vlan_filtering(struct dsa_switch *ds, int port,
174 return 0; 174 return 0;
175} 175}
176 176
177static int dsa_loop_port_vlan_prepare(struct dsa_switch *ds, int port, 177static int
178 const struct switchdev_obj_port_vlan *vlan, 178dsa_loop_port_vlan_prepare(struct dsa_switch *ds, int port,
179 struct switchdev_trans *trans) 179 const struct switchdev_obj_port_vlan *vlan)
180{ 180{
181 struct dsa_loop_priv *ps = ds->priv; 181 struct dsa_loop_priv *ps = ds->priv;
182 struct mii_bus *bus = ps->bus; 182 struct mii_bus *bus = ps->bus;
@@ -193,8 +193,7 @@ static int dsa_loop_port_vlan_prepare(struct dsa_switch *ds, int port,
193} 193}
194 194
195static void dsa_loop_port_vlan_add(struct dsa_switch *ds, int port, 195static void dsa_loop_port_vlan_add(struct dsa_switch *ds, int port,
196 const struct switchdev_obj_port_vlan *vlan, 196 const struct switchdev_obj_port_vlan *vlan)
197 struct switchdev_trans *trans)
198{ 197{
199 bool untagged = vlan->flags & BRIDGE_VLAN_INFO_UNTAGGED; 198 bool untagged = vlan->flags & BRIDGE_VLAN_INFO_UNTAGGED;
200 bool pvid = vlan->flags & BRIDGE_VLAN_INFO_PVID; 199 bool pvid = vlan->flags & BRIDGE_VLAN_INFO_PVID;
diff --git a/drivers/net/dsa/microchip/ksz_common.c b/drivers/net/dsa/microchip/ksz_common.c
index b5be93a1e0df..25b94edc5526 100644
--- a/drivers/net/dsa/microchip/ksz_common.c
+++ b/drivers/net/dsa/microchip/ksz_common.c
@@ -559,8 +559,7 @@ static int ksz_port_vlan_filtering(struct dsa_switch *ds, int port, bool flag)
559} 559}
560 560
561static int ksz_port_vlan_prepare(struct dsa_switch *ds, int port, 561static int ksz_port_vlan_prepare(struct dsa_switch *ds, int port,
562 const struct switchdev_obj_port_vlan *vlan, 562 const struct switchdev_obj_port_vlan *vlan)
563 struct switchdev_trans *trans)
564{ 563{
565 /* nothing needed */ 564 /* nothing needed */
566 565
@@ -568,8 +567,7 @@ static int ksz_port_vlan_prepare(struct dsa_switch *ds, int port,
568} 567}
569 568
570static void ksz_port_vlan_add(struct dsa_switch *ds, int port, 569static void ksz_port_vlan_add(struct dsa_switch *ds, int port,
571 const struct switchdev_obj_port_vlan *vlan, 570 const struct switchdev_obj_port_vlan *vlan)
572 struct switchdev_trans *trans)
573{ 571{
574 struct ksz_device *dev = ds->priv; 572 struct ksz_device *dev = ds->priv;
575 u32 vlan_table[3]; 573 u32 vlan_table[3];
diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index 8171055fde7a..eff624fbd220 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -1185,8 +1185,7 @@ static int mv88e6xxx_port_vlan_filtering(struct dsa_switch *ds, int port,
1185 1185
1186static int 1186static int
1187mv88e6xxx_port_vlan_prepare(struct dsa_switch *ds, int port, 1187mv88e6xxx_port_vlan_prepare(struct dsa_switch *ds, int port,
1188 const struct switchdev_obj_port_vlan *vlan, 1188 const struct switchdev_obj_port_vlan *vlan)
1189 struct switchdev_trans *trans)
1190{ 1189{
1191 struct mv88e6xxx_chip *chip = ds->priv; 1190 struct mv88e6xxx_chip *chip = ds->priv;
1192 int err; 1191 int err;
@@ -1295,8 +1294,7 @@ static int _mv88e6xxx_port_vlan_add(struct mv88e6xxx_chip *chip, int port,
1295} 1294}
1296 1295
1297static void mv88e6xxx_port_vlan_add(struct dsa_switch *ds, int port, 1296static void mv88e6xxx_port_vlan_add(struct dsa_switch *ds, int port,
1298 const struct switchdev_obj_port_vlan *vlan, 1297 const struct switchdev_obj_port_vlan *vlan)
1299 struct switchdev_trans *trans)
1300{ 1298{
1301 struct mv88e6xxx_chip *chip = ds->priv; 1299 struct mv88e6xxx_chip *chip = ds->priv;
1302 bool untagged = vlan->flags & BRIDGE_VLAN_INFO_UNTAGGED; 1300 bool untagged = vlan->flags & BRIDGE_VLAN_INFO_UNTAGGED;
diff --git a/include/net/dsa.h b/include/net/dsa.h
index 2a05738570d8..0c4fbb34379e 100644
--- a/include/net/dsa.h
+++ b/include/net/dsa.h
@@ -412,12 +412,10 @@ struct dsa_switch_ops {
412 */ 412 */
413 int (*port_vlan_filtering)(struct dsa_switch *ds, int port, 413 int (*port_vlan_filtering)(struct dsa_switch *ds, int port,
414 bool vlan_filtering); 414 bool vlan_filtering);
415 int (*port_vlan_prepare)(struct dsa_switch *ds, int port, 415 int (*port_vlan_prepare)(struct dsa_switch *ds, int port,
416 const struct switchdev_obj_port_vlan *vlan, 416 const struct switchdev_obj_port_vlan *vlan);
417 struct switchdev_trans *trans); 417 void (*port_vlan_add)(struct dsa_switch *ds, int port,
418 void (*port_vlan_add)(struct dsa_switch *ds, int port, 418 const struct switchdev_obj_port_vlan *vlan);
419 const struct switchdev_obj_port_vlan *vlan,
420 struct switchdev_trans *trans);
421 int (*port_vlan_del)(struct dsa_switch *ds, int port, 419 int (*port_vlan_del)(struct dsa_switch *ds, int port,
422 const struct switchdev_obj_port_vlan *vlan); 420 const struct switchdev_obj_port_vlan *vlan);
423 /* 421 /*
diff --git a/net/dsa/switch.c b/net/dsa/switch.c
index 29608d087a7c..205f074fa524 100644
--- a/net/dsa/switch.c
+++ b/net/dsa/switch.c
@@ -178,7 +178,7 @@ static int dsa_switch_vlan_add(struct dsa_switch *ds,
178 return -EOPNOTSUPP; 178 return -EOPNOTSUPP;
179 179
180 for_each_set_bit(port, members, ds->num_ports) { 180 for_each_set_bit(port, members, ds->num_ports) {
181 err = ds->ops->port_vlan_prepare(ds, port, vlan, trans); 181 err = ds->ops->port_vlan_prepare(ds, port, vlan);
182 if (err) 182 if (err)
183 return err; 183 return err;
184 } 184 }
@@ -187,7 +187,7 @@ static int dsa_switch_vlan_add(struct dsa_switch *ds,
187 } 187 }
188 188
189 for_each_set_bit(port, members, ds->num_ports) 189 for_each_set_bit(port, members, ds->num_ports)
190 ds->ops->port_vlan_add(ds, port, vlan, trans); 190 ds->ops->port_vlan_add(ds, port, vlan);
191 191
192 return 0; 192 return 0;
193} 193}