Skip to content

Commit 80e0236

Browse files
viviendavem330
authored andcommitted
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 raspberrypi#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>
1 parent 183dea5 commit 80e0236

7 files changed

Lines changed: 18 additions & 29 deletions

File tree

‎drivers/net/dsa/b53/b53_common.c‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,8 +1029,7 @@ int b53_vlan_filtering(struct dsa_switch *ds, int port, bool vlan_filtering)
10291029
EXPORT_SYMBOL(b53_vlan_filtering);
10301030

10311031
int b53_vlan_prepare(struct dsa_switch *ds, int port,
1032-
const struct switchdev_obj_port_vlan *vlan,
1033-
struct switchdev_trans *trans)
1032+
const struct switchdev_obj_port_vlan *vlan)
10341033
{
10351034
struct b53_device *dev = ds->priv;
10361035

@@ -1047,8 +1046,7 @@ int b53_vlan_prepare(struct dsa_switch *ds, int port,
10471046
EXPORT_SYMBOL(b53_vlan_prepare);
10481047

10491048
void b53_vlan_add(struct dsa_switch *ds, int port,
1050-
const struct switchdev_obj_port_vlan *vlan,
1051-
struct switchdev_trans *trans)
1049+
const struct switchdev_obj_port_vlan *vlan)
10521050
{
10531051
struct b53_device *dev = ds->priv;
10541052
bool untagged = vlan->flags & BRIDGE_VLAN_INFO_UNTAGGED;

‎drivers/net/dsa/b53/b53_priv.h‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -295,11 +295,9 @@ void b53_br_set_stp_state(struct dsa_switch *ds, int port, u8 state);
295295
void b53_br_fast_age(struct dsa_switch *ds, int port);
296296
int b53_vlan_filtering(struct dsa_switch *ds, int port, bool vlan_filtering);
297297
int b53_vlan_prepare(struct dsa_switch *ds, int port,
298-
const struct switchdev_obj_port_vlan *vlan,
299-
struct switchdev_trans *trans);
298+
const struct switchdev_obj_port_vlan *vlan);
300299
void b53_vlan_add(struct dsa_switch *ds, int port,
301-
const struct switchdev_obj_port_vlan *vlan,
302-
struct switchdev_trans *trans);
300+
const struct switchdev_obj_port_vlan *vlan);
303301
int b53_vlan_del(struct dsa_switch *ds, int port,
304302
const struct switchdev_obj_port_vlan *vlan);
305303
int b53_fdb_add(struct dsa_switch *ds, int port,

‎drivers/net/dsa/dsa_loop.c‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -174,9 +174,9 @@ static int dsa_loop_port_vlan_filtering(struct dsa_switch *ds, int port,
174174
return 0;
175175
}
176176

177-
static int dsa_loop_port_vlan_prepare(struct dsa_switch *ds, int port,
178-
const struct switchdev_obj_port_vlan *vlan,
179-
struct switchdev_trans *trans)
177+
static int
178+
dsa_loop_port_vlan_prepare(struct dsa_switch *ds, int port,
179+
const struct switchdev_obj_port_vlan *vlan)
180180
{
181181
struct dsa_loop_priv *ps = ds->priv;
182182
struct mii_bus *bus = ps->bus;
@@ -193,8 +193,7 @@ static int dsa_loop_port_vlan_prepare(struct dsa_switch *ds, int port,
193193
}
194194

195195
static void dsa_loop_port_vlan_add(struct dsa_switch *ds, int port,
196-
const struct switchdev_obj_port_vlan *vlan,
197-
struct switchdev_trans *trans)
196+
const struct switchdev_obj_port_vlan *vlan)
198197
{
199198
bool untagged = vlan->flags & BRIDGE_VLAN_INFO_UNTAGGED;
200199
bool pvid = vlan->flags & BRIDGE_VLAN_INFO_PVID;

‎drivers/net/dsa/microchip/ksz_common.c‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -559,17 +559,15 @@ static int ksz_port_vlan_filtering(struct dsa_switch *ds, int port, bool flag)
559559
}
560560

561561
static int ksz_port_vlan_prepare(struct dsa_switch *ds, int port,
562-
const struct switchdev_obj_port_vlan *vlan,
563-
struct switchdev_trans *trans)
562+
const struct switchdev_obj_port_vlan *vlan)
564563
{
565564
/* nothing needed */
566565

567566
return 0;
568567
}
569568

570569
static void ksz_port_vlan_add(struct dsa_switch *ds, int port,
571-
const struct switchdev_obj_port_vlan *vlan,
572-
struct switchdev_trans *trans)
570+
const struct switchdev_obj_port_vlan *vlan)
573571
{
574572
struct ksz_device *dev = ds->priv;
575573
u32 vlan_table[3];

‎drivers/net/dsa/mv88e6xxx/chip.c‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1185,8 +1185,7 @@ static int mv88e6xxx_port_vlan_filtering(struct dsa_switch *ds, int port,
11851185

11861186
static int
11871187
mv88e6xxx_port_vlan_prepare(struct dsa_switch *ds, int port,
1188-
const struct switchdev_obj_port_vlan *vlan,
1189-
struct switchdev_trans *trans)
1188+
const struct switchdev_obj_port_vlan *vlan)
11901189
{
11911190
struct mv88e6xxx_chip *chip = ds->priv;
11921191
int err;
@@ -1295,8 +1294,7 @@ static int _mv88e6xxx_port_vlan_add(struct mv88e6xxx_chip *chip, int port,
12951294
}
12961295

12971296
static void mv88e6xxx_port_vlan_add(struct dsa_switch *ds, int port,
1298-
const struct switchdev_obj_port_vlan *vlan,
1299-
struct switchdev_trans *trans)
1297+
const struct switchdev_obj_port_vlan *vlan)
13001298
{
13011299
struct mv88e6xxx_chip *chip = ds->priv;
13021300
bool untagged = vlan->flags & BRIDGE_VLAN_INFO_UNTAGGED;

‎include/net/dsa.h‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -412,12 +412,10 @@ struct dsa_switch_ops {
412412
*/
413413
int (*port_vlan_filtering)(struct dsa_switch *ds, int port,
414414
bool vlan_filtering);
415-
int (*port_vlan_prepare)(struct dsa_switch *ds, int port,
416-
const struct switchdev_obj_port_vlan *vlan,
417-
struct switchdev_trans *trans);
418-
void (*port_vlan_add)(struct dsa_switch *ds, int port,
419-
const struct switchdev_obj_port_vlan *vlan,
420-
struct switchdev_trans *trans);
415+
int (*port_vlan_prepare)(struct dsa_switch *ds, int port,
416+
const struct switchdev_obj_port_vlan *vlan);
417+
void (*port_vlan_add)(struct dsa_switch *ds, int port,
418+
const struct switchdev_obj_port_vlan *vlan);
421419
int (*port_vlan_del)(struct dsa_switch *ds, int port,
422420
const struct switchdev_obj_port_vlan *vlan);
423421
/*

‎net/dsa/switch.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ static int dsa_switch_vlan_add(struct dsa_switch *ds,
178178
return -EOPNOTSUPP;
179179

180180
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);
182182
if (err)
183183
return err;
184184
}
@@ -187,7 +187,7 @@ static int dsa_switch_vlan_add(struct dsa_switch *ds,
187187
}
188188

189189
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);
191191

192192
return 0;
193193
}

0 commit comments

Comments
 (0)