Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1718212

[PATCH 2/3] net: dsa: lan9303: constify dsa_switch_ops

From Arvind Yadav <arvind.yadav.cs@gmail.com>
Newsgroups linux.kernel
Subject [PATCH 2/3] net: dsa: lan9303: constify dsa_switch_ops
Date 2017-08-23 12:20 +0200
Message-ID <uhAVr-7G7-7@gated-at.bofh.it> (permalink)
References <uhAVr-7G7-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


dsa_switch_ops are not supposed to change at runtime. All functions
working with dsa_switch_ops provided by <net/dsa.h> work with
const dsa_switch_ops. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
 drivers/net/dsa/lan9303-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/dsa/lan9303-core.c b/drivers/net/dsa/lan9303-core.c
index cd76e61..d4820d2 100644
--- a/drivers/net/dsa/lan9303-core.c
+++ b/drivers/net/dsa/lan9303-core.c
@@ -780,7 +780,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,
-- 
1.9.1

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH 2/3] net: dsa: lan9303: constify dsa_switch_ops Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-08-23 12:20 +0200

csiph-web