diff mbox

[3/3] net: rsi: netlink: constify genl_ops

Message ID 1503482375-19983-4-git-send-email-arvind.yadav.cs@gmail.com
State Changes Requested, archived
Delegated to: David Miller
Headers show

Commit Message

Arvind Yadav Aug. 23, 2017, 9:59 a.m. UTC
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>
---
 net/tipc/netlink_compat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Kalle Valo Aug. 23, 2017, 10:02 a.m. UTC | #1
Arvind Yadav <arvind.yadav.cs@gmail.com> writes:

> 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>
> ---
>  net/tipc/netlink_compat.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Using the prefix "rsi:" looks wrong for this patch.
Arvind Yadav Aug. 23, 2017, 10:05 a.m. UTC | #2
Hi,


On Wednesday 23 August 2017 03:32 PM, Kalle Valo wrote:
> Arvind Yadav <arvind.yadav.cs@gmail.com> writes:
>
>> 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>
>> ---
>>   net/tipc/netlink_compat.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
> Using the prefix "rsi:" looks wrong for this patch.
Thanks for pointing. I will update.
>
~arvind
diff mbox

Patch

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,