linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 3/3 v2] net: netlink: constify genl_ops
@ 2017-08-23 10:08 Arvind Yadav
  2017-08-23 10:20 ` Kalle Valo
  0 siblings, 1 reply; 3+ messages in thread
From: Arvind Yadav @ 2017-08-23 10:08 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.

 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] 3+ messages in thread

* Re: [PATCH 3/3 v2] net: netlink: constify genl_ops
  2017-08-23 10:08 [PATCH 3/3 v2] net: netlink: constify genl_ops Arvind Yadav
@ 2017-08-23 10:20 ` Kalle Valo
  2017-08-23 10:24   ` Arvind Yadav
  0 siblings, 1 reply; 3+ messages in thread
From: Kalle Valo @ 2017-08-23 10:20 UTC (permalink / raw)
  To: Arvind Yadav
  Cc: davem, Larry.Finger, chaoming_li, jon.maloy, ying.xue,
	linux-kernel, linux-wireless, netdev

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>
> ---
> Changes in v2:
>              Patch Subject was wrong.
>
>  net/tipc/netlink_compat.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

I don't think the title is still misleading. Other patches have used
"tipc:", I think you should use the same:

$ git log --oneline --no-merges -20 net/tipc
41c6d650f653 net: convert sock.sk_refcnt from atomic_t to refcount_t
343eba69c696 net: tipc: Fix a sleep-in-atomic bug in tipc_msg_reverse
844cf763fba6 tipc: make macro tipc_wait_for_cond() smp safe
ec8a09fbbeff tipc: refactor function tipc_sk_recv_stream()
e9f8b10101c6 tipc: refactor function tipc_sk_recvmsg()
c1be7756284b tipc: close the connection if protocol messages contain errors
4e0df4951e9e tipc: improve error validations for sockets in CONNECTING state
42b531de17d2 tipc: Fix missing connection request handling
05ff8378975a tipc: fix socket flow control accounting error at tipc_recv_stream
3364d61c92ec tipc: fix socket flow control accounting error at tipc_send_stream
78302fd40576 tipc: check return value of nlmsg_new
fe52145f91fe netlink: pass extended ACK struct where available
fceb6435e852 netlink: pass extended ACK struct to parsing functions
66bc1e8d5d1d tipc: allow rdm/dgram socketpairs
70b03759e9ec tipc: add support for stream/seqpacket socketpairs
7efea60dcffc tipc: adjust the policy of holding subscription kref
139bb36f754a tipc: advance the time of deleting subscription from subscriber->subscrp_list
557d054c01da tipc: fix nametbl deadlock at tipc_nametbl_unsubscribe
cdfbabfb2f0c net: Work around lockdep limitation in sockets that use sockets
174cd4b1e5fb sched/headers: Prepare to move signal wakeup & sigpending methods from <linux/sched.h> into <linux/sched/signal.h>

-- 
Kalle Valo

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

* Re: [PATCH 3/3 v2] net: netlink: constify genl_ops
  2017-08-23 10:20 ` Kalle Valo
@ 2017-08-23 10:24   ` Arvind Yadav
  0 siblings, 0 replies; 3+ messages in thread
From: Arvind Yadav @ 2017-08-23 10:24 UTC (permalink / raw)
  To: Kalle Valo
  Cc: davem, Larry.Finger, chaoming_li, jon.maloy, ying.xue,
	linux-kernel, linux-wireless, netdev

Hi Kalle,


On Wednesday 23 August 2017 03:50 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>
>> ---
>> Changes in v2:
>>               Patch Subject was wrong.
>>
>>   net/tipc/netlink_compat.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
> I don't think the title is still misleading. Other patches have used
> "tipc:", I think you should use the same:
Ok, I will update as per your suggestion.
>
> $ git log --oneline --no-merges -20 net/tipc
> 41c6d650f653 net: convert sock.sk_refcnt from atomic_t to refcount_t
> 343eba69c696 net: tipc: Fix a sleep-in-atomic bug in tipc_msg_reverse
> 844cf763fba6 tipc: make macro tipc_wait_for_cond() smp safe
> ec8a09fbbeff tipc: refactor function tipc_sk_recv_stream()
> e9f8b10101c6 tipc: refactor function tipc_sk_recvmsg()
> c1be7756284b tipc: close the connection if protocol messages contain errors
> 4e0df4951e9e tipc: improve error validations for sockets in CONNECTING state
> 42b531de17d2 tipc: Fix missing connection request handling
> 05ff8378975a tipc: fix socket flow control accounting error at tipc_recv_stream
> 3364d61c92ec tipc: fix socket flow control accounting error at tipc_send_stream
> 78302fd40576 tipc: check return value of nlmsg_new
> fe52145f91fe netlink: pass extended ACK struct where available
> fceb6435e852 netlink: pass extended ACK struct to parsing functions
> 66bc1e8d5d1d tipc: allow rdm/dgram socketpairs
> 70b03759e9ec tipc: add support for stream/seqpacket socketpairs
> 7efea60dcffc tipc: adjust the policy of holding subscription kref
> 139bb36f754a tipc: advance the time of deleting subscription from subscriber->subscrp_list
> 557d054c01da tipc: fix nametbl deadlock at tipc_nametbl_unsubscribe
> cdfbabfb2f0c net: Work around lockdep limitation in sockets that use sockets
> 174cd4b1e5fb sched/headers: Prepare to move signal wakeup & sigpending methods from <linux/sched.h> into <linux/sched/signal.h>
>
~arvind

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

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

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-23 10:08 [PATCH 3/3 v2] net: netlink: constify genl_ops Arvind Yadav
2017-08-23 10:20 ` Kalle Valo
2017-08-23 10:24   ` Arvind Yadav

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