From: Arvind Yadav <arvind.yadav.cs@gmail.com>
To: andrew@lunn.ch, vivien.didelot@savoirfairelinux.com,
f.fainelli@gmail.com
Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: [PATCH 2/3] net: dsa: lan9303: constify dsa_switch_ops
Date: Wed, 23 Aug 2017 15:46:58 +0530 [thread overview]
Message-ID: <1503483419-21780-3-git-send-email-arvind.yadav.cs@gmail.com> (raw)
In-Reply-To: <1503483419-21780-1-git-send-email-arvind.yadav.cs@gmail.com>
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
next prev parent reply other threads:[~2017-08-23 10:16 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-23 10:16 [PATCH 0/3] constify dsa_switch_ops Arvind Yadav
2017-08-23 10:16 ` [PATCH 1/3] net: dsa: loop: " Arvind Yadav
2017-08-23 10:16 ` Arvind Yadav [this message]
2017-08-23 10:16 ` [PATCH 3/3] net: dsa: mt7530: " Arvind Yadav
2017-08-23 12:45 ` [PATCH 0/3] " Andrew Lunn
2017-08-24 5:30 ` 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=1503483419-21780-3-git-send-email-arvind.yadav.cs@gmail.com \
--to=arvind.yadav.cs@gmail.com \
--cc=andrew@lunn.ch \
--cc=f.fainelli@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=vivien.didelot@savoirfairelinux.com \
/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;
as well as URLs for NNTP newsgroup(s).