net/smc: mark smc_pnet_policy as const
authorDmitry Vyukov <dvyukov@google.com>
Mon, 25 May 2020 15:31:58 +0000 (17:31 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 27 May 2020 03:19:13 +0000 (20:19 -0700)
Netlink policies are generally declared as const.
This is safer and prevents potential bugs.

Signed-off-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/smc/smc_pnet.c

index be03f12..014d91b 100644 (file)
@@ -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