]> git.proxmox.com Git - ovs.git/commitdiff
netdev: Make netdev_set_mtu() netdev parameter non-const.
authorDaniele Di Proietto <diproiettod@vmware.com>
Tue, 9 Aug 2016 16:01:19 +0000 (17:01 +0100)
committerDaniele Di Proietto <diproiettod@vmware.com>
Sat, 13 Aug 2016 02:32:12 +0000 (19:32 -0700)
Every provider silently drops the const attribute when converting the
parameter to the appropriate subclass.  Might as well drop the const
attribute from the parameter, since this is a "set" function.

Signed-off-by: Daniele Di Proietto <diproiettod@vmware.com>
Acked-by: Ilya Maximets <i.maximets@samsung.com>
lib/netdev-dummy.c
lib/netdev-linux.c
lib/netdev-provider.h
lib/netdev.c
lib/netdev.h

index a950409316eb1757ede04e08c220a595b2ae67a8..28f5a46d270c46b17af061e3701cf8e3481d2776 100644 (file)
@@ -1144,7 +1144,7 @@ netdev_dummy_get_mtu(const struct netdev *netdev, int *mtup)
 }
 
 static int
-netdev_dummy_set_mtu(const struct netdev *netdev, int mtu)
+netdev_dummy_set_mtu(struct netdev *netdev, int mtu)
 {
     struct netdev_dummy *dev = netdev_dummy_cast(netdev);
 
index 41173d2867a8564b8c71a876ac84d10af329fa8a..f31e8038d76ebe9dffa82d4e098f1696d3f15d65 100644 (file)
@@ -1382,7 +1382,7 @@ netdev_linux_get_mtu(const struct netdev *netdev_, int *mtup)
  * networking ioctl interface.
  */
 static int
-netdev_linux_set_mtu(const struct netdev *netdev_, int mtu)
+netdev_linux_set_mtu(struct netdev *netdev_, int mtu)
 {
     struct netdev_linux *netdev = netdev_linux_cast(netdev_);
     struct ifreq ifr;
index ae390cb178f972072563bed98f62d8f9485f2524..663fa23e539cdf876af134651767501e24412aec 100644 (file)
@@ -383,7 +383,7 @@ struct netdev_class {
      * If 'netdev' does not have an MTU (e.g. as some tunnels do not), then
      * this function should return EOPNOTSUPP.  This function may be set to
      * null if it would always return EOPNOTSUPP. */
-    int (*set_mtu)(const struct netdev *netdev, int mtu);
+    int (*set_mtu)(struct netdev *netdev, int mtu);
 
     /* Returns the ifindex of 'netdev', if successful, as a positive number.
      * On failure, returns a negative errno value.
index 75bf1cb06eb355be66f245e95d94d02fe037e332..e7a1fa91f556d4b97142c3d6294b3d35df985d69 100644 (file)
@@ -869,7 +869,7 @@ netdev_get_mtu(const struct netdev *netdev, int *mtup)
  * MTU (as e.g. some tunnels do not).  On other failure, returns a positive
  * errno value. */
 int
-netdev_set_mtu(const struct netdev *netdev, int mtu)
+netdev_set_mtu(struct netdev *netdev, int mtu)
 {
     const struct netdev_class *class = netdev->netdev_class;
     int error;
index dc7ede81e5fa017de6c6cb7f76d098718957e9d1..d8ec62798331da1c2f25e8072d017acda5a62528 100644 (file)
@@ -132,7 +132,7 @@ const char *netdev_get_name(const struct netdev *);
 const char *netdev_get_type(const struct netdev *);
 const char *netdev_get_type_from_name(const char *);
 int netdev_get_mtu(const struct netdev *, int *mtup);
-int netdev_set_mtu(const struct netdev *, int mtu);
+int netdev_set_mtu(struct netdev *, int mtu);
 int netdev_get_ifindex(const struct netdev *);
 int netdev_set_tx_multiq(struct netdev *, unsigned int n_txq);