diff options
author | Jiri Pirko <jiri@mellanox.com> | 2015-10-14 13:40:49 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-10-15 09:09:46 -0400 |
commit | f7fadf3047d005d17376da65aa9e5734f45a77d4 (patch) | |
tree | a5387868be0e0daf8c8f3d76b4fd764717cf4401 | |
parent | 793f40147e82cdedc80971fa7f5596d6ed1e555e (diff) |
switchdev: make struct switchdev_attr parameter const for attr_set calls
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/rocker/rocker.c | 2 | ||||
-rw-r--r-- | include/net/switchdev.h | 6 | ||||
-rw-r--r-- | net/dsa/slave.c | 2 | ||||
-rw-r--r-- | net/switchdev/switchdev.c | 7 |
4 files changed, 9 insertions, 8 deletions
diff --git a/drivers/net/ethernet/rocker/rocker.c b/drivers/net/ethernet/rocker/rocker.c index eafa907965ec..f0e820d2b8ec 100644 --- a/drivers/net/ethernet/rocker/rocker.c +++ b/drivers/net/ethernet/rocker/rocker.c | |||
@@ -4374,7 +4374,7 @@ static int rocker_port_bridge_ageing_time(struct rocker_port *rocker_port, | |||
4374 | } | 4374 | } |
4375 | 4375 | ||
4376 | static int rocker_port_attr_set(struct net_device *dev, | 4376 | static int rocker_port_attr_set(struct net_device *dev, |
4377 | struct switchdev_attr *attr, | 4377 | const struct switchdev_attr *attr, |
4378 | struct switchdev_trans *trans) | 4378 | struct switchdev_trans *trans) |
4379 | { | 4379 | { |
4380 | struct rocker_port *rocker_port = netdev_priv(dev); | 4380 | struct rocker_port *rocker_port = netdev_priv(dev); |
diff --git a/include/net/switchdev.h b/include/net/switchdev.h index 31b9038e07b0..d1c7f901ea61 100644 --- a/include/net/switchdev.h +++ b/include/net/switchdev.h | |||
@@ -132,7 +132,7 @@ struct switchdev_ops { | |||
132 | int (*switchdev_port_attr_get)(struct net_device *dev, | 132 | int (*switchdev_port_attr_get)(struct net_device *dev, |
133 | struct switchdev_attr *attr); | 133 | struct switchdev_attr *attr); |
134 | int (*switchdev_port_attr_set)(struct net_device *dev, | 134 | int (*switchdev_port_attr_set)(struct net_device *dev, |
135 | struct switchdev_attr *attr, | 135 | const struct switchdev_attr *attr, |
136 | struct switchdev_trans *trans); | 136 | struct switchdev_trans *trans); |
137 | int (*switchdev_port_obj_add)(struct net_device *dev, | 137 | int (*switchdev_port_obj_add)(struct net_device *dev, |
138 | const struct switchdev_obj *obj, | 138 | const struct switchdev_obj *obj, |
@@ -171,7 +171,7 @@ void switchdev_deferred_process(void); | |||
171 | int switchdev_port_attr_get(struct net_device *dev, | 171 | int switchdev_port_attr_get(struct net_device *dev, |
172 | struct switchdev_attr *attr); | 172 | struct switchdev_attr *attr); |
173 | int switchdev_port_attr_set(struct net_device *dev, | 173 | int switchdev_port_attr_set(struct net_device *dev, |
174 | struct switchdev_attr *attr); | 174 | const struct switchdev_attr *attr); |
175 | int switchdev_port_obj_add(struct net_device *dev, | 175 | int switchdev_port_obj_add(struct net_device *dev, |
176 | const struct switchdev_obj *obj); | 176 | const struct switchdev_obj *obj); |
177 | int switchdev_port_obj_del(struct net_device *dev, | 177 | int switchdev_port_obj_del(struct net_device *dev, |
@@ -220,7 +220,7 @@ static inline int switchdev_port_attr_get(struct net_device *dev, | |||
220 | } | 220 | } |
221 | 221 | ||
222 | static inline int switchdev_port_attr_set(struct net_device *dev, | 222 | static inline int switchdev_port_attr_set(struct net_device *dev, |
223 | struct switchdev_attr *attr) | 223 | const struct switchdev_attr *attr) |
224 | { | 224 | { |
225 | return -EOPNOTSUPP; | 225 | return -EOPNOTSUPP; |
226 | } | 226 | } |
diff --git a/net/dsa/slave.c b/net/dsa/slave.c index 43d7342e7527..84cd8639e37b 100644 --- a/net/dsa/slave.c +++ b/net/dsa/slave.c | |||
@@ -453,7 +453,7 @@ static int dsa_slave_stp_update(struct net_device *dev, u8 state) | |||
453 | } | 453 | } |
454 | 454 | ||
455 | static int dsa_slave_port_attr_set(struct net_device *dev, | 455 | static int dsa_slave_port_attr_set(struct net_device *dev, |
456 | struct switchdev_attr *attr, | 456 | const struct switchdev_attr *attr, |
457 | struct switchdev_trans *trans) | 457 | struct switchdev_trans *trans) |
458 | { | 458 | { |
459 | struct dsa_slave_priv *p = netdev_priv(dev); | 459 | struct dsa_slave_priv *p = netdev_priv(dev); |
diff --git a/net/switchdev/switchdev.c b/net/switchdev/switchdev.c index 5e64b591aff7..23b4e5b347dc 100644 --- a/net/switchdev/switchdev.c +++ b/net/switchdev/switchdev.c | |||
@@ -215,7 +215,7 @@ int switchdev_port_attr_get(struct net_device *dev, struct switchdev_attr *attr) | |||
215 | EXPORT_SYMBOL_GPL(switchdev_port_attr_get); | 215 | EXPORT_SYMBOL_GPL(switchdev_port_attr_get); |
216 | 216 | ||
217 | static int __switchdev_port_attr_set(struct net_device *dev, | 217 | static int __switchdev_port_attr_set(struct net_device *dev, |
218 | struct switchdev_attr *attr, | 218 | const struct switchdev_attr *attr, |
219 | struct switchdev_trans *trans) | 219 | struct switchdev_trans *trans) |
220 | { | 220 | { |
221 | const struct switchdev_ops *ops = dev->switchdev_ops; | 221 | const struct switchdev_ops *ops = dev->switchdev_ops; |
@@ -274,7 +274,7 @@ static void switchdev_port_attr_set_work(struct work_struct *work) | |||
274 | } | 274 | } |
275 | 275 | ||
276 | static int switchdev_port_attr_set_defer(struct net_device *dev, | 276 | static int switchdev_port_attr_set_defer(struct net_device *dev, |
277 | struct switchdev_attr *attr) | 277 | const struct switchdev_attr *attr) |
278 | { | 278 | { |
279 | struct switchdev_attr_set_work *asw; | 279 | struct switchdev_attr_set_work *asw; |
280 | 280 | ||
@@ -303,7 +303,8 @@ static int switchdev_port_attr_set_defer(struct net_device *dev, | |||
303 | * system is not left in a partially updated state due to | 303 | * system is not left in a partially updated state due to |
304 | * failure from driver/device. | 304 | * failure from driver/device. |
305 | */ | 305 | */ |
306 | int switchdev_port_attr_set(struct net_device *dev, struct switchdev_attr *attr) | 306 | int switchdev_port_attr_set(struct net_device *dev, |
307 | const struct switchdev_attr *attr) | ||
307 | { | 308 | { |
308 | struct switchdev_trans trans; | 309 | struct switchdev_trans trans; |
309 | int err; | 310 | int err; |