linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 3/3 v3] net: tipc: constify genl_ops
@ 2017-08-23 10:52 Arvind Yadav
  2017-08-24  5:32 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Arvind Yadav @ 2017-08-23 10:52 UTC (permalink / raw)
  To: davem, Larry.Finger, chaoming_li, kvalo, jon.maloy, ying.xue
  Cc: linux-kernel, linux-wireless, netdev

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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 3/3 v3] net: tipc: constify genl_ops
  2017-08-23 10:52 [PATCH 3/3 v3] net: tipc: constify genl_ops Arvind Yadav
@ 2017-08-24  5:32 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2017-08-24  5:32 UTC (permalink / raw)
  To: arvind.yadav.cs
  Cc: Larry.Finger, chaoming_li, kvalo, jon.maloy, ying.xue,
	linux-kernel, linux-wireless, netdev

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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-08-24  5:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-23 10:52 [PATCH 3/3 v3] net: tipc: constify genl_ops Arvind Yadav
2017-08-24  5:32 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).