From patchwork Wed Oct 14 17:40:49 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Pirko X-Patchwork-Id: 530316 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 1F66F140FD9 for ; Thu, 15 Oct 2015 04:42:44 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932855AbbJNRmk (ORCPT ); Wed, 14 Oct 2015 13:42:40 -0400 Received: from mail-wi0-f181.google.com ([209.85.212.181]:35200 "EHLO mail-wi0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753680AbbJNRlB (ORCPT ); Wed, 14 Oct 2015 13:41:01 -0400 Received: by wicll6 with SMTP id ll6so7866909wic.0 for ; Wed, 14 Oct 2015 10:40:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=C69DNZ1EECk5cfR43wl5qF79EU/26GzQ0GvLMyqkvSY=; b=OM7Dmc4NtSVn+taO5bW8OdmrhmrbHdzBlq7QAmO00HlBfdctsF0N+CFm1bin0IdV7A wyyxZCqFcz5KEmyzddscRIgWOQFfEf9ZZkpup+H9NJmjAnuG4UqnmXEmWFUwfXtst3Ol WOKMct3Y/3C7wCREirW8tcN3HD5rATOn8zCGI6LwDPJN5PMJJ0B8ix85C1OH8QVMdqxF Ux5dMPNBKNipS9r4EvjYdJOZSqFYlVObsKapkl6GACTBGMfqnvESFXqneTZkpv0r0GaN RiPvU0Rz3rWmFJgjWaNGn/bAxN1KK9BmZErQPnSAH9yy4bJMNCHZxUK8YIYalVx3RBgr UwJw== X-Gm-Message-State: ALoCoQm4YyrtT6UhvGE+qnM8iqdVv6CkpoVrctwnIcxiBZfzkZDWbCiWNyQOCufGkcLA/NcMayYx X-Received: by 10.180.77.106 with SMTP id r10mr16146839wiw.84.1444844459882; Wed, 14 Oct 2015 10:40:59 -0700 (PDT) Received: from localhost (ip-94-113-120-24.net.upcbroadband.cz. [94.113.120.24]) by smtp.gmail.com with ESMTPSA id i3sm20157851wij.9.2015.10.14.10.40.59 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Oct 2015 10:40:59 -0700 (PDT) From: Jiri Pirko To: netdev@vger.kernel.org Cc: davem@davemloft.net, idosch@mellanox.com, eladr@mellanox.com, sfeldma@gmail.com, f.fainelli@gmail.com, linux@roeck-us.net, vivien.didelot@savoirfairelinux.com, andrew@lunn.ch, john.fastabend@gmail.com, David.Laight@ACULAB.COM, stephen@networkplumber.org Subject: [patch net-next v5 2/8] switchdev: make struct switchdev_attr parameter const for attr_set calls Date: Wed, 14 Oct 2015 19:40:49 +0200 Message-Id: <1444844455-12508-3-git-send-email-jiri@resnulli.us> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1444844455-12508-1-git-send-email-jiri@resnulli.us> References: <1444844455-12508-1-git-send-email-jiri@resnulli.us> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jiri Pirko Signed-off-by: Jiri Pirko Reviewed-by: Vivien Didelot --- drivers/net/ethernet/rocker/rocker.c | 2 +- include/net/switchdev.h | 6 +++--- net/dsa/slave.c | 2 +- net/switchdev/switchdev.c | 7 ++++--- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/net/ethernet/rocker/rocker.c b/drivers/net/ethernet/rocker/rocker.c index eafa907..f0e820d 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 31b9038..d1c7f90 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 43d7342..84cd863 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 5e64b59..23b4e5b 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;