Skip to contentSkip to conversation

net/smc: mark smc_pnet_policy as const

PATCH Applied Dmitry Vyukov 2 participants 2 messages May 25, 2020 – May 27, 2020

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/smc: mark smc_pnet_policy as const

Netlink policies are generally declared as const.
This is safer and prevents potential bugs.

---
 net/smc/smc_pnet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/smc/smc_pnet.c +1 -1
index 2a5ed47c3e08..45d5ea570293 100644
@@ -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
Signature · 1 line
2.27.0.rc0.183.gde8f92d652-goog