From patchwork Mon Aug 8 10:24:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Kavanagh X-Patchwork-Id: 656644 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 3s7D7y61dbz9sR9 for ; Mon, 8 Aug 2016 20:25:34 +1000 (AEST) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 502AA106CE; Mon, 8 Aug 2016 03:25:15 -0700 (PDT) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx1e3.cudamail.com (mx1.cudamail.com [69.90.118.67]) by archives.nicira.com (Postfix) with ESMTPS id 53E541068F for ; Mon, 8 Aug 2016 03:25:12 -0700 (PDT) Received: from bar5.cudamail.com (localhost [127.0.0.1]) by mx1e3.cudamail.com (Postfix) with ESMTPS id DF466420515 for ; Mon, 8 Aug 2016 04:25:11 -0600 (MDT) X-ASG-Debug-ID: 1470651911-09eadd5e86447690001-byXFYA Received: from mx1-pf1.cudamail.com ([192.168.24.1]) by bar5.cudamail.com with ESMTP id ISOjlz514mJZtmvI (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 08 Aug 2016 04:25:11 -0600 (MDT) X-Barracuda-Envelope-From: mark.b.kavanagh@intel.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.24.1 Received: from unknown (HELO mga14.intel.com) (192.55.52.115) by mx1-pf1.cudamail.com with SMTP; 8 Aug 2016 10:25:11 -0000 Received-SPF: pass (mx1-pf1.cudamail.com: SPF record at intel.com designates 192.55.52.115 as permitted sender) X-Barracuda-Apparent-Source-IP: 192.55.52.115 X-Barracuda-RBL-IP: 192.55.52.115 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP; 08 Aug 2016 03:25:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.28,489,1464678000"; d="scan'208"; a="1021558521" Received: from silpixa00380299.ir.intel.com ([10.237.222.17]) by fmsmga001.fm.intel.com with ESMTP; 08 Aug 2016 03:25:09 -0700 X-CudaMail-Envelope-Sender: mark.b.kavanagh@intel.com From: Mark Kavanagh To: dev@openvswitch.org, diproiettod@vmware.com X-CudaMail-MID: CM-E1-807004063 X-CudaMail-DTE: 080816 X-CudaMail-Originating-IP: 192.55.52.115 Date: Mon, 8 Aug 2016 11:24:33 +0100 X-ASG-Orig-Subj: [##CM-E1-807004063##][ovs-dev][PATCH V3 6/7] netdev: Make netdev_set_mtu() netdev parameter non-const. Message-Id: <1470651874-53972-6-git-send-email-mark.b.kavanagh@intel.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1470651874-53972-1-git-send-email-mark.b.kavanagh@intel.com> References: <1470651874-53972-1-git-send-email-mark.b.kavanagh@intel.com> X-Barracuda-Connect: UNKNOWN[192.168.24.1] X-Barracuda-Start-Time: 1470651911 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://web.cudamail.com:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at cudamail.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.60 X-Barracuda-Spam-Status: No, SCORE=0.60 using global scores of TAG_LEVEL=3.5 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=4.0 tests=BSF_SC5_MJ1963, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.31836 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS 0.50 BSF_SC5_MJ1963 Custom Rule MJ1963 Cc: i.maximets@samsung.com Subject: [ovs-dev] [PATCH V3 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" From: Daniele Di Proietto 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 --- 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);