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>
diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index 43d7342..84cd863 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -453,7 +453,7 @@
}
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 5e64b59..23b4e5b 100644
--- a/net/switchdev/switchdev.c
+++ b/net/switchdev/switchdev.c
@@ -215,7 +215,7 @@
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 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 @@
* 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;