net: bridge: constify variables in the replay helpers
Some of the arguments and local variables for the newly added switchdev replay helpers can be const, so let's make them so. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
0d2cfbd41c
commit
bdf123b455
|
@ -104,8 +104,8 @@ static inline bool br_multicast_router(const struct net_device *dev)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
static inline int br_mdb_replay(struct net_device *br_dev,
|
static inline int br_mdb_replay(const struct net_device *br_dev,
|
||||||
struct net_device *dev, const void *ctx,
|
const struct net_device *dev, const void *ctx,
|
||||||
struct notifier_block *nb,
|
struct notifier_block *nb,
|
||||||
struct netlink_ext_ack *extack)
|
struct netlink_ext_ack *extack)
|
||||||
{
|
{
|
||||||
|
@ -166,8 +166,8 @@ struct net_device *br_fdb_find_port(const struct net_device *br_dev,
|
||||||
void br_fdb_clear_offload(const struct net_device *dev, u16 vid);
|
void br_fdb_clear_offload(const struct net_device *dev, u16 vid);
|
||||||
bool br_port_flag_is_set(const struct net_device *dev, unsigned long flag);
|
bool br_port_flag_is_set(const struct net_device *dev, unsigned long flag);
|
||||||
u8 br_port_get_stp_state(const struct net_device *dev);
|
u8 br_port_get_stp_state(const struct net_device *dev);
|
||||||
clock_t br_get_ageing_time(struct net_device *br_dev);
|
clock_t br_get_ageing_time(const struct net_device *br_dev);
|
||||||
int br_fdb_replay(struct net_device *br_dev, struct net_device *dev,
|
int br_fdb_replay(const struct net_device *br_dev, const struct net_device *dev,
|
||||||
const void *ctx, struct notifier_block *nb);
|
const void *ctx, struct notifier_block *nb);
|
||||||
#else
|
#else
|
||||||
static inline struct net_device *
|
static inline struct net_device *
|
||||||
|
@ -193,13 +193,13 @@ static inline u8 br_port_get_stp_state(const struct net_device *dev)
|
||||||
return BR_STATE_DISABLED;
|
return BR_STATE_DISABLED;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline clock_t br_get_ageing_time(struct net_device *br_dev)
|
static inline clock_t br_get_ageing_time(const struct net_device *br_dev)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int br_fdb_replay(struct net_device *br_dev,
|
static inline int br_fdb_replay(const struct net_device *br_dev,
|
||||||
struct net_device *dev, const void *ctx,
|
const struct net_device *dev, const void *ctx,
|
||||||
struct notifier_block *nb)
|
struct notifier_block *nb)
|
||||||
{
|
{
|
||||||
return -EOPNOTSUPP;
|
return -EOPNOTSUPP;
|
||||||
|
|
|
@ -727,7 +727,7 @@ static inline size_t fdb_nlmsg_size(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int br_fdb_replay_one(struct notifier_block *nb,
|
static int br_fdb_replay_one(struct notifier_block *nb,
|
||||||
struct net_bridge_fdb_entry *fdb,
|
const struct net_bridge_fdb_entry *fdb,
|
||||||
struct net_device *dev, const void *ctx)
|
struct net_device *dev, const void *ctx)
|
||||||
{
|
{
|
||||||
struct switchdev_notifier_fdb_info item;
|
struct switchdev_notifier_fdb_info item;
|
||||||
|
@ -745,7 +745,7 @@ static int br_fdb_replay_one(struct notifier_block *nb,
|
||||||
return notifier_to_errno(err);
|
return notifier_to_errno(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
int br_fdb_replay(struct net_device *br_dev, struct net_device *dev,
|
int br_fdb_replay(const struct net_device *br_dev, const struct net_device *dev,
|
||||||
const void *ctx, struct notifier_block *nb)
|
const void *ctx, struct notifier_block *nb)
|
||||||
{
|
{
|
||||||
struct net_bridge_fdb_entry *fdb;
|
struct net_bridge_fdb_entry *fdb;
|
||||||
|
@ -760,7 +760,7 @@ int br_fdb_replay(struct net_device *br_dev, struct net_device *dev,
|
||||||
rcu_read_lock();
|
rcu_read_lock();
|
||||||
|
|
||||||
hlist_for_each_entry_rcu(fdb, &br->fdb_list, fdb_node) {
|
hlist_for_each_entry_rcu(fdb, &br->fdb_list, fdb_node) {
|
||||||
struct net_bridge_port *dst = READ_ONCE(fdb->dst);
|
const struct net_bridge_port *dst = READ_ONCE(fdb->dst);
|
||||||
struct net_device *dst_dev;
|
struct net_device *dst_dev;
|
||||||
|
|
||||||
dst_dev = dst ? dst->dev : br->dev;
|
dst_dev = dst ? dst->dev : br->dev;
|
||||||
|
|
|
@ -567,7 +567,7 @@ static void br_switchdev_mdb_populate(struct switchdev_obj_port_mdb *mdb,
|
||||||
}
|
}
|
||||||
|
|
||||||
static int br_mdb_replay_one(struct notifier_block *nb, struct net_device *dev,
|
static int br_mdb_replay_one(struct notifier_block *nb, struct net_device *dev,
|
||||||
struct switchdev_obj_port_mdb *mdb,
|
const struct switchdev_obj_port_mdb *mdb,
|
||||||
const void *ctx, struct netlink_ext_ack *extack)
|
const void *ctx, struct netlink_ext_ack *extack)
|
||||||
{
|
{
|
||||||
struct switchdev_notifier_port_obj_info obj_info = {
|
struct switchdev_notifier_port_obj_info obj_info = {
|
||||||
|
@ -607,7 +607,7 @@ int br_mdb_replay(struct net_device *br_dev, struct net_device *dev,
|
||||||
const void *ctx, struct notifier_block *nb,
|
const void *ctx, struct notifier_block *nb,
|
||||||
struct netlink_ext_ack *extack)
|
struct netlink_ext_ack *extack)
|
||||||
{
|
{
|
||||||
struct net_bridge_mdb_entry *mp;
|
const struct net_bridge_mdb_entry *mp;
|
||||||
struct switchdev_obj *obj, *tmp;
|
struct switchdev_obj *obj, *tmp;
|
||||||
struct net_bridge *br;
|
struct net_bridge *br;
|
||||||
LIST_HEAD(mdb_list);
|
LIST_HEAD(mdb_list);
|
||||||
|
@ -634,8 +634,8 @@ int br_mdb_replay(struct net_device *br_dev, struct net_device *dev,
|
||||||
rcu_read_lock();
|
rcu_read_lock();
|
||||||
|
|
||||||
hlist_for_each_entry_rcu(mp, &br->mdb_list, mdb_node) {
|
hlist_for_each_entry_rcu(mp, &br->mdb_list, mdb_node) {
|
||||||
struct net_bridge_port_group __rcu **pp;
|
struct net_bridge_port_group __rcu * const *pp;
|
||||||
struct net_bridge_port_group *p;
|
const struct net_bridge_port_group *p;
|
||||||
|
|
||||||
if (mp->host_joined) {
|
if (mp->host_joined) {
|
||||||
err = br_mdb_queue_one(&mdb_list,
|
err = br_mdb_queue_one(&mdb_list,
|
||||||
|
|
|
@ -639,9 +639,9 @@ int br_set_ageing_time(struct net_bridge *br, clock_t ageing_time)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
clock_t br_get_ageing_time(struct net_device *br_dev)
|
clock_t br_get_ageing_time(const struct net_device *br_dev)
|
||||||
{
|
{
|
||||||
struct net_bridge *br;
|
const struct net_bridge *br;
|
||||||
|
|
||||||
if (!netif_is_bridge_master(br_dev))
|
if (!netif_is_bridge_master(br_dev))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue