summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Pirko <jiri@mellanox.com>2015-10-14 20:40:49 +0300
committerDavid S. Miller <davem@davemloft.net>2015-10-15 16:09:46 +0300
commitf7fadf3047d005d17376da65aa9e5734f45a77d4 (patch)
treea5387868be0e0daf8c8f3d76b4fd764717cf4401
parent793f40147e82cdedc80971fa7f5596d6ed1e555e (diff)
downloadlinux-f7fadf3047d005d17376da65aa9e5734f45a77d4.tar.xz
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.c2
-rw-r--r--include/net/switchdev.h6
-rw-r--r--net/dsa/slave.c2
-rw-r--r--net/switchdev/switchdev.c7
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,
}
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);
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 {
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,
@@ -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,
@@ -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;
}
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)
}
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);
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)
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;
@@ -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;
@@ -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;