linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] Revert "net: dsa: constify cpu_dp member of dsa_port"
@ 2017-11-09 14:39 Vivien Didelot
  2017-11-09 19:47 ` Florian Fainelli
  2017-11-09 22:06 ` Andrew Lunn
  0 siblings, 2 replies; 4+ messages in thread
From: Vivien Didelot @ 2017-11-09 14:39 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.
---
 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] 4+ messages in thread

* Re: [PATCH net-next] Revert "net: dsa: constify cpu_dp member of dsa_port"
  2017-11-09 14:39 [PATCH net-next] Revert "net: dsa: constify cpu_dp member of dsa_port" Vivien Didelot
@ 2017-11-09 19:47 ` Florian Fainelli
  2017-11-09 22:06 ` Andrew Lunn
  1 sibling, 0 replies; 4+ messages in thread
From: Florian Fainelli @ 2017-11-09 19:47 UTC (permalink / raw)
  To: Vivien Didelot, netdev; +Cc: linux-kernel, kernel, David S. Miller, Andrew Lunn

On 11/09/2017 06:39 AM, Vivien Didelot wrote:
> 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.

Missing signed-off-by, with that fixed:

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] Revert "net: dsa: constify cpu_dp member of dsa_port"
  2017-11-09 14:39 [PATCH net-next] Revert "net: dsa: constify cpu_dp member of dsa_port" Vivien Didelot
  2017-11-09 19:47 ` Florian Fainelli
@ 2017-11-09 22:06 ` Andrew Lunn
  2017-11-09 22:21   ` Vivien Didelot
  1 sibling, 1 reply; 4+ messages in thread
From: Andrew Lunn @ 2017-11-09 22:06 UTC (permalink / raw)
  To: Vivien Didelot
  Cc: netdev, linux-kernel, kernel, David S. Miller, Florian Fainelli

On Thu, Nov 09, 2017 at 09:39:32AM -0500, Vivien Didelot wrote:
> 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.

Hi Vivien

We cannot make cpu_dp const yet. But we can change dsa_port_mdb_add()
and friends to take a const, because they don't need to modify it.

So NACK.

And i will add the needed const attributes to these functions as part
of the IGMP patchset.

    Andrew

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] Revert "net: dsa: constify cpu_dp member of dsa_port"
  2017-11-09 22:06 ` Andrew Lunn
@ 2017-11-09 22:21   ` Vivien Didelot
  0 siblings, 0 replies; 4+ messages in thread
From: Vivien Didelot @ 2017-11-09 22:21 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: netdev, linux-kernel, kernel, David S. Miller, Florian Fainelli

Hi Andrew,

Andrew Lunn <andrew@lunn.ch> writes:

> And i will add the needed const attributes to these functions as part
> of the IGMP patchset.

Sounds good, not need for this revert then.


Thanks,

        Vivien

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-11-09 22:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-09 14:39 [PATCH net-next] Revert "net: dsa: constify cpu_dp member of dsa_port" Vivien Didelot
2017-11-09 19:47 ` Florian Fainelli
2017-11-09 22:06 ` Andrew Lunn
2017-11-09 22:21   ` 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).