OSDN Git Service

net: tipc: constify genl_ops
authorArvind Yadav <arvind.yadav.cs@gmail.com>
Wed, 23 Aug 2017 10:52:20 +0000 (16:22 +0530)
committerDavid S. Miller <davem@davemloft.net>
Thu, 24 Aug 2017 05:31:38 +0000 (22:31 -0700)
genl_ops are not supposed to change at runtime. All functions
working with genl_ops provided by <net/genetlink.h> work with
const genl_ops. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tipc/netlink_compat.c

index 750949d..e48f0b2 100644 (file)
@@ -1217,7 +1217,7 @@ send:
        return err;
 }
 
-static struct genl_ops tipc_genl_compat_ops[] = {
+static const struct genl_ops tipc_genl_compat_ops[] = {
        {
                .cmd            = TIPC_GENL_CMD,
                .doit           = tipc_nl_compat_recv,