* [PATCH net-next v2] Revert "net: dsa: constify cpu_dp member of dsa_port"
@ 2017-11-09 19:56 Vivien Didelot
2017-11-09 22:24 ` Vivien Didelot
0 siblings, 1 reply; 2+ messages in thread
From: Vivien Didelot @ 2017-11-09 19:56 UTC (permalink / raw)
To: netdev
Cc: linux-kernel, kernel, David S. Miller, Florian Fainelli,
Andrew Lunn, Vivien Didelot
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@savoirfairelinux.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next v2] Revert "net: dsa: constify cpu_dp member of dsa_port"
2017-11-09 19:56 [PATCH net-next v2] Revert "net: dsa: constify cpu_dp member of dsa_port" Vivien Didelot
@ 2017-11-09 22:24 ` Vivien Didelot
0 siblings, 0 replies; 2+ messages in thread
From: Vivien Didelot @ 2017-11-09 22:24 UTC (permalink / raw)
To: netdev
Cc: linux-kernel, kernel, David S. Miller, Florian Fainelli, Andrew Lunn
Hi David,
Vivien Didelot <vivien.didelot@savoirfairelinux.com> writes:
> 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.
No need to apply this revert, Andrew made the dsa_port_mdb_* functions
take a const dsa_port in his new IGMP patchset so that we can keep the
cpu_dp const, as it should be.
Thanks,
Vivien
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-11-09 22:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-09 19:56 [PATCH net-next v2] Revert "net: dsa: constify cpu_dp member of dsa_port" Vivien Didelot
2017-11-09 22:24 ` Vivien Didelot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).