diff mbox series

net/smc: mark smc_pnet_policy as const

Message ID 20200525153158.247394-1-dvyukov@google.com
State Accepted
Delegated to: David Miller
Headers show
Series net/smc: mark smc_pnet_policy as const | expand

Commit Message

Dmitry Vyukov May 25, 2020, 3:31 p.m. UTC
Netlink policies are generally declared as const.
This is safer and prevents potential bugs.

Signed-off-by: Dmitry Vyukov <dvyukov@google.com>
---
 net/smc/smc_pnet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

David Miller May 27, 2020, 3:19 a.m. UTC | #1
From: Dmitry Vyukov <dvyukov@google.com>
Date: Mon, 25 May 2020 17:31:58 +0200

> Netlink policies are generally declared as const.
> This is safer and prevents potential bugs.
> 
> Signed-off-by: Dmitry Vyukov <dvyukov@google.com>

Applied to net-next, thanks.
diff mbox series

Patch

diff --git a/net/smc/smc_pnet.c b/net/smc/smc_pnet.c
index 2a5ed47c3e08..45d5ea570293 100644
--- a/net/smc/smc_pnet.c
+++ b/net/smc/smc_pnet.c
@@ -32,7 +32,7 @@ 
 
 static struct net_device *pnet_find_base_ndev(struct net_device *ndev);
 
-static struct nla_policy smc_pnet_policy[SMC_PNETID_MAX + 1] = {
+static const struct nla_policy smc_pnet_policy[SMC_PNETID_MAX + 1] = {
 	[SMC_PNETID_NAME] = {
 		.type = NLA_NUL_STRING,
 		.len = SMC_MAX_PNETID_LEN