Skip to content

Commit

Permalink
switchdev: make struct switchdev_attr parameter const for attr_set calls
Browse files Browse the repository at this point in the history
Signed-off-by: Jiri Pirko <[email protected]>
Reviewed-by: Vivien Didelot <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
jpirko authored and davem330 committed Oct 15, 2015
1 parent 793f401 commit f7fadf3
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/rocker/rocker.c
Original file line number Diff line number Diff line change
Expand Up @@ -4374,7 +4374,7 @@ static int rocker_port_bridge_ageing_time(struct rocker_port *rocker_port,
}

static int rocker_port_attr_set(struct net_device *dev,
struct switchdev_attr *attr,
const struct switchdev_attr *attr,
struct switchdev_trans *trans)
{
struct rocker_port *rocker_port = netdev_priv(dev);
Expand Down
6 changes: 3 additions & 3 deletions include/net/switchdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ struct switchdev_ops {
int (*switchdev_port_attr_get)(struct net_device *dev,
struct switchdev_attr *attr);
int (*switchdev_port_attr_set)(struct net_device *dev,
struct switchdev_attr *attr,
const struct switchdev_attr *attr,
struct switchdev_trans *trans);
int (*switchdev_port_obj_add)(struct net_device *dev,
const struct switchdev_obj *obj,
Expand Down Expand Up @@ -171,7 +171,7 @@ void switchdev_deferred_process(void);
int switchdev_port_attr_get(struct net_device *dev,
struct switchdev_attr *attr);
int switchdev_port_attr_set(struct net_device *dev,
struct switchdev_attr *attr);
const struct switchdev_attr *attr);
int switchdev_port_obj_add(struct net_device *dev,
const struct switchdev_obj *obj);
int switchdev_port_obj_del(struct net_device *dev,
Expand Down Expand Up @@ -220,7 +220,7 @@ static inline int switchdev_port_attr_get(struct net_device *dev,
}

static inline int switchdev_port_attr_set(struct net_device *dev,
struct switchdev_attr *attr)
const struct switchdev_attr *attr)
{
return -EOPNOTSUPP;
}
Expand Down
2 changes: 1 addition & 1 deletion net/dsa/slave.c
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ static int dsa_slave_stp_update(struct net_device *dev, u8 state)
}

static int dsa_slave_port_attr_set(struct net_device *dev,
struct switchdev_attr *attr,
const struct switchdev_attr *attr,
struct switchdev_trans *trans)
{
struct dsa_slave_priv *p = netdev_priv(dev);
Expand Down
7 changes: 4 additions & 3 deletions net/switchdev/switchdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ int switchdev_port_attr_get(struct net_device *dev, struct switchdev_attr *attr)
EXPORT_SYMBOL_GPL(switchdev_port_attr_get);

static int __switchdev_port_attr_set(struct net_device *dev,
struct switchdev_attr *attr,
const struct switchdev_attr *attr,
struct switchdev_trans *trans)
{
const struct switchdev_ops *ops = dev->switchdev_ops;
Expand Down Expand Up @@ -274,7 +274,7 @@ static void switchdev_port_attr_set_work(struct work_struct *work)
}

static int switchdev_port_attr_set_defer(struct net_device *dev,
struct switchdev_attr *attr)
const struct switchdev_attr *attr)
{
struct switchdev_attr_set_work *asw;

Expand Down Expand Up @@ -303,7 +303,8 @@ static int switchdev_port_attr_set_defer(struct net_device *dev,
* system is not left in a partially updated state due to
* failure from driver/device.
*/
int switchdev_port_attr_set(struct net_device *dev, struct switchdev_attr *attr)
int switchdev_port_attr_set(struct net_device *dev,
const struct switchdev_attr *attr)
{
struct switchdev_trans trans;
int err;
Expand Down

0 comments on commit f7fadf3

Please sign in to comment.