From patchwork Sat Jul 30 01:22:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniele Di Proietto X-Patchwork-Id: 654243 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (archives.nicira.com [96.126.127.54]) by ozlabs.org (Postfix) with ESMTP id 3s1SXY0HsFz9sxS for ; Sat, 30 Jul 2016 11:23:24 +1000 (AEST) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 5FFF910B2F; Fri, 29 Jul 2016 18:23:18 -0700 (PDT) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx3v3.cudamail.com (mx3.cudamail.com [64.34.241.5]) by archives.nicira.com (Postfix) with ESMTPS id 5A7761168F for ; Fri, 29 Jul 2016 18:23:17 -0700 (PDT) Received: from bar6.cudamail.com (localhost [127.0.0.1]) by mx3v3.cudamail.com (Postfix) with ESMTPS id DE34A160F7E for ; Fri, 29 Jul 2016 19:23:16 -0600 (MDT) X-ASG-Debug-ID: 1469841796-0b32374d327bea0001-byXFYA Received: from mx3-pf2.cudamail.com ([192.168.14.1]) by bar6.cudamail.com with ESMTP id IrWA8bmlEoWcRIvq (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 29 Jul 2016 19:23:16 -0600 (MDT) X-Barracuda-Envelope-From: diproiettod@vmware.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.14.1 Received: from unknown (HELO smtp-outbound-2.vmware.com) (208.91.2.13) by mx3-pf2.cudamail.com with ESMTPS (DHE-RSA-AES256-SHA encrypted); 30 Jul 2016 01:23:16 -0000 Received-SPF: error (mx3-pf2.cudamail.com: error in processing during lookup of vmware.com: DNS problem) X-Barracuda-Apparent-Source-IP: 208.91.2.13 X-Barracuda-RBL-IP: 208.91.2.13 Received: from sc9-mailhost1.vmware.com (sc9-mailhost1.vmware.com [10.113.161.71]) by smtp-outbound-2.vmware.com (Postfix) with ESMTP id AAD3B98064 for ; Fri, 29 Jul 2016 18:23:14 -0700 (PDT) Received: from sc9-mailhost2.vmware.com (htb-1n-eng-dhcp84.eng.vmware.com [10.33.74.84]) by sc9-mailhost1.vmware.com (Postfix) with ESMTP id CEDB418590; Fri, 29 Jul 2016 18:23:15 -0700 (PDT) X-CudaMail-Envelope-Sender: diproiettod@vmware.com From: Daniele Di Proietto To: dev@openvswitch.org X-CudaMail-Whitelist-To: dev@openvswitch.org X-CudaMail-MID: CM-V2-728050358 X-CudaMail-DTE: 072916 X-CudaMail-Originating-IP: 208.91.2.13 Date: Fri, 29 Jul 2016 18:22:51 -0700 X-ASG-Orig-Subj: [##CM-V2-728050358##][PATCH 6/7] netdev: Make netdev_set_mtu() netdev parameter non-const. Message-Id: <1469841772-119013-6-git-send-email-diproiettod@vmware.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1469841772-119013-1-git-send-email-diproiettod@vmware.com> References: <1469841772-119013-1-git-send-email-diproiettod@vmware.com> X-Barracuda-Connect: UNKNOWN[192.168.14.1] X-Barracuda-Start-Time: 1469841796 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://web.cudamail.com:443/cgi-mod/mark.cgi X-ASG-Whitelist: Header =?UTF-8?B?eFwtY3VkYW1haWxcLXdoaXRlbGlzdFwtdG8=?= X-Virus-Scanned: by bsmtpd at cudamail.com X-Barracuda-BRTS-Status: 1 X-ASG-Whitelist: EmailCat (corporate) Subject: [ovs-dev] [PATCH 6/7] netdev: Make netdev_set_mtu() netdev parameter non-const. X-BeenThere: dev@openvswitch.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dev-bounces@openvswitch.org Sender: "dev" 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. --- lib/netdev-dummy.c | 2 +- lib/netdev-linux.c | 2 +- lib/netdev-provider.h | 2 +- lib/netdev.c | 2 +- lib/netdev.h | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/netdev-dummy.c b/lib/netdev-dummy.c index c8f82b7..dec1a8e 100644 --- a/lib/netdev-dummy.c +++ b/lib/netdev-dummy.c @@ -1150,7 +1150,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); diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c index 1b5f7c1..20b5cc7 100644 --- a/lib/netdev-linux.c +++ b/lib/netdev-linux.c @@ -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; diff --git a/lib/netdev-provider.h b/lib/netdev-provider.h index 5bcfeba..cd04ae9 100644 --- a/lib/netdev-provider.h +++ b/lib/netdev-provider.h @@ -389,7 +389,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. diff --git a/lib/netdev.c b/lib/netdev.c index 589d37c..5cf8bbb 100644 --- a/lib/netdev.c +++ b/lib/netdev.c @@ -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; diff --git a/lib/netdev.h b/lib/netdev.h index dc7ede8..d8ec627 100644 --- a/lib/netdev.h +++ b/lib/netdev.h @@ -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);