net: dsa: make dsa_switch_ops const
authorBhumika Goyal <bhumirks@gmail.com>
Wed, 9 Aug 2017 05:04:15 +0000 (10:34 +0530)
committerDavid S. Miller <davem@davemloft.net>
Thu, 10 Aug 2017 05:42:49 +0000 (22:42 -0700)
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/dsa_loop.c
drivers/net/dsa/lan9303-core.c
drivers/net/dsa/mt7530.c

index 76d66604a34e0edd3152e3e5ddf630974ca52165..7819a9fe83215329217e2965633736f9c26e9d8c 100644 (file)
@@ -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,
index 46fc1d5d3c9eb2f09fe3ec14c0c9d61836fe4950..b471413d3df9829c26833d482867a9671a299c08 100644 (file)
@@ -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,
index 8faa796a115fcf82b8cf1e2f80426143a430de04..c142b97add2cd3d3f937b81e5749b4258e66bc80 100644 (file)
@@ -1017,7 +1017,7 @@ mt7530_setup(struct dsa_switch *ds)
        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,