mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
To: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, kernel@savoirfairelinux.com,
	"David S. Miller" <davem@davemloft.net>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Andrew Lunn <andrew@lunn.ch>,
	Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Subject: [PATCH net-next 01/11] net: dsa: constify cpu_dp member of dsa_port
Date: Mon,  6 Nov 2017 16:11:43 -0500	[thread overview]
Message-ID: <20171106211153.26529-2-vivien.didelot@savoirfairelinux.com> (raw)
In-Reply-To: <20171106211153.26529-1-vivien.didelot@savoirfairelinux.com>

A DSA port has a dedicated CPU port assigned to it, stored in the cpu_dp
member. It is not meant to be modified by a port, thus make it const.

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.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 e54332968417..2a8613b5a23d 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;
-	struct dsa_port		*cpu_dp;
+	const 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 814ced75a0cc..cc7fe47dd4bf 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)
 {
-	struct dsa_port *cpu_dp = port->cpu_dp;
+	const 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.14.3

  reply	other threads:[~2017-11-06 21:12 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-06 21:11 [PATCH net-next 00/11] net: dsa: setup stage Vivien Didelot
2017-11-06 21:11 ` Vivien Didelot [this message]
2017-11-07  1:47   ` [PATCH net-next 01/11] net: dsa: constify cpu_dp member of dsa_port Florian Fainelli
2017-11-06 21:11 ` [PATCH net-next 02/11] net: dsa: setup and teardown default CPU port Vivien Didelot
2017-11-06 21:11 ` [PATCH net-next 03/11] net: dsa: setup and teardown master device Vivien Didelot
2017-11-06 21:11 ` [PATCH net-next 04/11] net: dsa: setup and teardown tree Vivien Didelot
2017-11-06 21:11 ` [PATCH net-next 05/11] net: dsa: setup and teardown switches Vivien Didelot
2017-11-06 21:11 ` [PATCH net-next 06/11] net: dsa: setup and teardown ports Vivien Didelot
2017-11-06 21:11 ` [PATCH net-next 07/11] net: dsa: add find port by node helper Vivien Didelot
2017-11-06 21:11 ` [PATCH net-next 08/11] net: dsa: use of_for_each_phandle Vivien Didelot
2017-11-06 21:11 ` [PATCH net-next 09/11] net: dsa: setup routing table Vivien Didelot
2017-11-06 21:11 ` [PATCH net-next 10/11] net: dsa: setup a tree when adding a switch to it Vivien Didelot
2017-11-06 21:11 ` [PATCH net-next 11/11] net: dsa: rename probe and remove switch functions Vivien Didelot
2017-11-09  0:29 ` [PATCH net-next 00/11] net: dsa: setup stage David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171106211153.26529-2-vivien.didelot@savoirfairelinux.com \
    --to=vivien.didelot@savoirfairelinux.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=kernel@savoirfairelinux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®