Skip to content

Commit bb9f603

Browse files
lunndavem330
authored andcommitted
net: dsa: add more const attributes
The notify mechanism does not need to modify the port it is notifying. So make the parameter const. Signed-off-by: Andrew Lunn <[email protected]> Reviewed-by: Vivien Didelot <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 5f4dbc5 commit bb9f603

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

net/dsa/dsa_priv.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,10 @@ int dsa_port_fdb_add(struct dsa_port *dp, const unsigned char *addr,
147147
int dsa_port_fdb_del(struct dsa_port *dp, const unsigned char *addr,
148148
u16 vid);
149149
int dsa_port_fdb_dump(struct dsa_port *dp, dsa_fdb_dump_cb_t *cb, void *data);
150-
int dsa_port_mdb_add(struct dsa_port *dp,
150+
int dsa_port_mdb_add(const struct dsa_port *dp,
151151
const struct switchdev_obj_port_mdb *mdb,
152152
struct switchdev_trans *trans);
153-
int dsa_port_mdb_del(struct dsa_port *dp,
153+
int dsa_port_mdb_del(const struct dsa_port *dp,
154154
const struct switchdev_obj_port_mdb *mdb);
155155
int dsa_port_vlan_add(struct dsa_port *dp,
156156
const struct switchdev_obj_port_vlan *vlan,

net/dsa/port.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
#include "dsa_priv.h"
1919

20-
static int dsa_port_notify(struct dsa_port *dp, unsigned long e, void *v)
20+
static int dsa_port_notify(const struct dsa_port *dp, unsigned long e, void *v)
2121
{
2222
struct raw_notifier_head *nh = &dp->ds->dst->nh;
2323
int err;
@@ -215,7 +215,7 @@ int dsa_port_fdb_dump(struct dsa_port *dp, dsa_fdb_dump_cb_t *cb, void *data)
215215
return ds->ops->port_fdb_dump(ds, port, cb, data);
216216
}
217217

218-
int dsa_port_mdb_add(struct dsa_port *dp,
218+
int dsa_port_mdb_add(const struct dsa_port *dp,
219219
const struct switchdev_obj_port_mdb *mdb,
220220
struct switchdev_trans *trans)
221221
{
@@ -229,7 +229,7 @@ int dsa_port_mdb_add(struct dsa_port *dp,
229229
return dsa_port_notify(dp, DSA_NOTIFIER_MDB_ADD, &info);
230230
}
231231

232-
int dsa_port_mdb_del(struct dsa_port *dp,
232+
int dsa_port_mdb_del(const struct dsa_port *dp,
233233
const struct switchdev_obj_port_mdb *mdb)
234234
{
235235
struct dsa_notifier_mdb_info info = {

0 commit comments

Comments
 (0)