* [PATCH] net: dsa: make dsa_switch_ops const
@ 2017-08-09 5:04 Bhumika Goyal
2017-08-09 14:32 ` Vivien Didelot
2017-08-10 5:43 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Bhumika Goyal @ 2017-08-09 5:04 UTC (permalink / raw)
To: julia.lawall, andrew, vivien.didelot, f.fainelli, netdev, linux-kernel
Cc: Bhumika Goyal
Make these structures const as they are only stored in the ops field of
a dsa_switch structure, which is const.
Done using Coccinelle.
Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
---
drivers/net/dsa/dsa_loop.c | 2 +-
drivers/net/dsa/lan9303-core.c | 2 +-
drivers/net/dsa/mt7530.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/dsa/dsa_loop.c b/drivers/net/dsa/dsa_loop.c
index 76d6660..7819a9f 100644
--- a/drivers/net/dsa/dsa_loop.c
+++ b/drivers/net/dsa/dsa_loop.c
@@ -257,7 +257,7 @@ static int dsa_loop_port_vlan_del(struct dsa_switch *ds, int port,
return 0;
}
-static struct dsa_switch_ops dsa_loop_driver = {
+static const struct dsa_switch_ops dsa_loop_driver = {
.get_tag_protocol = dsa_loop_get_protocol,
.setup = dsa_loop_setup,
.get_strings = dsa_loop_get_strings,
diff --git a/drivers/net/dsa/lan9303-core.c b/drivers/net/dsa/lan9303-core.c
index 15befd1..f058f98 100644
--- a/drivers/net/dsa/lan9303-core.c
+++ b/drivers/net/dsa/lan9303-core.c
@@ -797,7 +797,7 @@ static void lan9303_port_disable(struct dsa_switch *ds, int port,
}
}
-static struct dsa_switch_ops lan9303_switch_ops = {
+static const struct dsa_switch_ops lan9303_switch_ops = {
.get_tag_protocol = lan9303_get_tag_protocol,
.setup = lan9303_setup,
.get_strings = lan9303_get_strings,
diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c
index 1270071..7d8cf927 100644
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -979,7 +979,7 @@ static void mt7530_adjust_link(struct dsa_switch *ds, int port,
return 0;
}
-static struct dsa_switch_ops mt7530_switch_ops = {
+static const struct dsa_switch_ops mt7530_switch_ops = {
.get_tag_protocol = mtk_get_tag_protocol,
.setup = mt7530_setup,
.get_strings = mt7530_get_strings,
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] net: dsa: make dsa_switch_ops const
2017-08-09 5:04 [PATCH] net: dsa: make dsa_switch_ops const Bhumika Goyal
@ 2017-08-09 14:32 ` Vivien Didelot
2017-08-10 5:43 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Vivien Didelot @ 2017-08-09 14:32 UTC (permalink / raw)
To: Bhumika Goyal, julia.lawall, andrew, f.fainelli, netdev, linux-kernel
Cc: Bhumika Goyal
Bhumika Goyal <bhumirks@gmail.com> writes:
> Make these structures const as they are only stored in the ops field of
> a dsa_switch structure, which is const.
> Done using Coccinelle.
>
> Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] net: dsa: make dsa_switch_ops const
2017-08-09 5:04 [PATCH] net: dsa: make dsa_switch_ops const Bhumika Goyal
2017-08-09 14:32 ` Vivien Didelot
@ 2017-08-10 5:43 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2017-08-10 5:43 UTC (permalink / raw)
To: bhumirks
Cc: julia.lawall, andrew, vivien.didelot, f.fainelli, netdev, linux-kernel
From: Bhumika Goyal <bhumirks@gmail.com>
Date: Wed, 9 Aug 2017 10:34:15 +0530
> Make these structures const as they are only stored in the ops field of
> a dsa_switch structure, which is const.
> Done using Coccinelle.
>
> Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Applied, thank you.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-08-10 5:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-09 5:04 [PATCH] net: dsa: make dsa_switch_ops const Bhumika Goyal
2017-08-09 14:32 ` Vivien Didelot
2017-08-10 5:43 ` David Miller
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).