Skip to content

Commit 24a9332

Browse files
viviendavem330
authored andcommitted
net: dsa: constify cpu_dp member of dsa_port
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> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent b2d0f5d commit 24a9332

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

include/net/dsa.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ struct dsa_port {
190190
struct dsa_switch *ds;
191191
unsigned int index;
192192
const char *name;
193-
struct dsa_port *cpu_dp;
193+
const struct dsa_port *cpu_dp;
194194
struct device_node *dn;
195195
unsigned int ageing_time;
196196
u8 stp_state;

net/dsa/slave.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1147,7 +1147,7 @@ static void dsa_slave_notify(struct net_device *dev, unsigned long val)
11471147

11481148
int dsa_slave_create(struct dsa_port *port)
11491149
{
1150-
struct dsa_port *cpu_dp = port->cpu_dp;
1150+
const struct dsa_port *cpu_dp = port->cpu_dp;
11511151
struct net_device *master = cpu_dp->master;
11521152
struct dsa_switch *ds = port->ds;
11531153
const char *name = port->name;

0 commit comments

Comments
 (0)