[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20171109195609.28068-1-vivien.didelot@savoirfairelinux.com>
Date: Thu, 9 Nov 2017 14:56:09 -0500
From: Vivien Didelot <vivien.didelot@...oirfairelinux.com>
To: netdev@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, kernel@...oirfairelinux.com,
"David S. Miller" <davem@...emloft.net>,
Florian Fainelli <f.fainelli@...il.com>,
Andrew Lunn <andrew@...n.ch>,
Vivien Didelot <vivien.didelot@...oirfairelinux.com>
Subject: [PATCH net-next v2] Revert "net: dsa: constify cpu_dp member of dsa_port"
We may have to pass a port's dedicated CPU port to port-wide functions
such as dsa_port_mdb_add, e.g. when offloading bridge device's MDB.
The DSA port-wide functions currently take a non-const struct dsa_port *
as first argument so we cannot make cpu_dp const yet, even though it'd
be more correct. Revert this patch and make cpu_dp non-const again.
This reverts commit 24a9332a58b7f41a0d36c35a2c6897242bffdbc0.
Signed-off-by: Vivien Didelot <vivien.didelot@...oirfairelinux.com>
Reviewed-by: Florian Fainelli <f.fainelli@...il.com>
---
include/net/dsa.h | 2 +-
net/dsa/slave.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/net/dsa.h b/include/net/dsa.h
index 6c239257309b..35b5dee7bb23 100644
--- a/include/net/dsa.h
+++ b/include/net/dsa.h
@@ -190,7 +190,7 @@ struct dsa_port {
struct dsa_switch *ds;
unsigned int index;
const char *name;
- const struct dsa_port *cpu_dp;
+ struct dsa_port *cpu_dp;
struct device_node *dn;
unsigned int ageing_time;
u8 stp_state;
diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index cc7fe47dd4bf..814ced75a0cc 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -1147,7 +1147,7 @@ static void dsa_slave_notify(struct net_device *dev, unsigned long val)
int dsa_slave_create(struct dsa_port *port)
{
- const struct dsa_port *cpu_dp = port->cpu_dp;
+ struct dsa_port *cpu_dp = port->cpu_dp;
struct net_device *master = cpu_dp->master;
struct dsa_switch *ds = port->ds;
const char *name = port->name;
--
2.15.0
Powered by blists - more mailing lists