Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1718244 > unrolled thread

[PATCH 3/3 v3] net: tipc: constify genl_ops

Started byArvind Yadav <arvind.yadav.cs@gmail.com>
First post2017-08-23 13:00 +0200
Last post2017-08-24 07:40 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 3/3 v3] net: tipc: constify genl_ops Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-08-23 13:00 +0200
    Re: [PATCH 3/3 v3] net: tipc: constify genl_ops David Miller <davem@davemloft.net> - 2017-08-24 07:40 +0200

#1718244 — [PATCH 3/3 v3] net: tipc: constify genl_ops

FromArvind Yadav <arvind.yadav.cs@gmail.com>
Date2017-08-23 13:00 +0200
Subject[PATCH 3/3 v3] net: tipc: constify genl_ops
Message-ID<uhBy9-7Te-9@gated-at.bofh.it>
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>
---
Changes in v2:
             Patch Subject was wrong.
changes in v3 :
             Updated patch subject as per comment.

 net/tipc/netlink_compat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/tipc/netlink_compat.c b/net/tipc/netlink_compat.c
index 750949d..e48f0b2 100644
--- a/net/tipc/netlink_compat.c
+++ b/net/tipc/netlink_compat.c
@@ -1217,7 +1217,7 @@ static int tipc_nl_compat_recv(struct sk_buff *skb, struct genl_info *info)
 	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,
-- 
1.9.1

[toc] | [next] | [standalone]


#1718846

FromDavid Miller <davem@davemloft.net>
Date2017-08-24 07:40 +0200
Message-ID<uhT22-2ii-9@gated-at.bofh.it>
In reply to#1718244
From: Arvind Yadav <arvind.yadav.cs@gmail.com>
Date: Wed, 23 Aug 2017 16:22:20 +0530

> 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>

Applied.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web