net: TCP/IP: A few minor cleanups
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest3 patches 6 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | net: __sock_cmsg_send(): Remove unused parameter `msg'include/ net/ net/ +1 more | +5 | 0 replies | |
| 1/3 | net: __sock_cmsg_send(): Remove unused parameter `msg'include/ net/ net/ +1 more | +5 | 0 replies | |
| 2/3 | net: inet_recvmsg(): Remove unnecessary bitwise operationnet/ | +1 | 0 replies | |
| 2/3 | net: inet_recvmsg(): Remove unnecessary bitwise operationnet/ | +1 | 0 replies | |
| 3/3 | net: skb_queue_purge(): lock/unlock the list only oncenet/ | +5 | 2 replies | |
| 3/3 | net: skb_queue_purge(): lock/unlock the queue only oncenet/ | +18 | 1 reply | |
| 3/3 | net: skb_queue_purge(): lock/unlock the queue only oncenet/ | +18 | 3 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/3] net: TCP/IP: A few minor cleanups
The following patch series is an ad hoc "cleanup" that I made while perusing the code (I'm not well versed in this code, so I would not be surprised if there were objections to the changes):
[1] net: __sock_cmsg_send(): Remove unused parameter `msg'
[2] net: inet_recvmsg(): Remove unnecessary bitwise operation.
[3] net: skb_queue_purge(): lock/unlock the list only once
Each patch will be sent as an individiual email; the total diff is appended below for your convenience.
You may also fetch these patches from GitHub:
git checkout -b test 5969d1bb3082b41eba8fd2c826559abe38ccb6df git pull https://github.com/mfwitten/linux.git net/tcp-ip/01-cleanup/00
Overall:
include/net/sock.h | 2 +- net/core/skbuff.c | 6 +++++- net/core/sock.c | 4 ++-- net/ipv4/af_inet.c | 2 +- net/ipv4/ip_sockglue.c | 2 +- net/ipv6/datagram.c | 2 +- 6 files changed, 11 insertions(+), 7 deletions(-)
Sincerly,
Michael Witten
include/net/sock.h +1 -1
@@ -1562,7 +1562,7 @@ struct sockcm_cookie {u16 tsflags; }; -int __sock_cmsg_send (struct sock *sk,struct msghdr *msg,struct cmsghdr *cmsg, +int __sock_cmsg_send (struct sock *sk,struct cmsghdr *cmsg,struct sockcm_cookie *sockc);int sock_cmsg_send (struct sock *sk,struct msghdr *msg,struct sockcm_cookie *sockc);
net/core/sock.c +2 -2
@@ -2091,7 +2091,7 @@ struct sk_buff *sock_alloc_send_skb(struct sock *sk, unsigned long size, }EXPORT_SYMBOL (sock_alloc_send_skb); -int __sock_cmsg_send (struct sock *sk,struct msghdr *msg,struct cmsghdr *cmsg, +int __sock_cmsg_send (struct sock *sk,struct cmsghdr *cmsg,struct sockcm_cookie *sockc) {u32 tsflags;
@@ -2137,7 +2137,7 @@ int sock_cmsg_send(struct sock *sk, struct msghdr *msg,return -EINVAL ;if (cmsg->cmsg_level !=SOL_SOCKET )continue ; - ret =__sock_cmsg_send (sk, msg, cmsg, sockc); + ret =__sock_cmsg_send (sk, cmsg, sockc);if (ret)return ret; }
net/ipv4/ip_sockglue.c +1 -1
@@ -263,7 +263,7 @@ int ip_cmsg_send(struct sock *sk, struct msghdr *msg, struct ipcm_cookie *ipc, }#endif if (cmsg->cmsg_level ==SOL_SOCKET ) { - err =__sock_cmsg_send (sk, msg, cmsg, &ipc->sockc); + err =__sock_cmsg_send (sk, cmsg, &ipc->sockc);if (err)return err;continue ;
net/ipv6/datagram.c +1 -1
@@ -756,7 +756,7 @@ int ip6_datagram_send_ctl(struct net *net, struct sock *sk, }if (cmsg->cmsg_level ==SOL_SOCKET ) { - err =__sock_cmsg_send (sk, msg, cmsg, sockc); + err =__sock_cmsg_send (sk, cmsg, sockc);if (err)return err;continue ;
net/ipv4/af_inet.c +1 -1
@@ -791,7 +791,7 @@ int inet_recvmsg(struct socket *sock, struct msghdr *msg, size_t size,sock_rps_record_flow (sk); err = sk->sk_prot->recvmsg (sk, msg, size, flags &MSG_DONTWAIT , - flags & ~MSG_DONTWAIT , &addr_len); + flags, &addr_len);if (err >=0 ) msg->msg_namelen = addr_len;return err;
net/core/skbuff.c +5 -1
@@ -2834,9 +2834,13 @@ EXPORT_SYMBOL(skb_dequeue_tail);*/ void skb_queue_purge (struct sk_buff_head *list) { +unsigned long flags;struct sk_buff *skb; -while ((skb =skb_dequeue (list)) !=NULL ) + +spin_lock_irqsave (&list->lock, flags); +while ((skb =__skb_dequeue (list)) !=NULL )kfree_skb (skb); +spin_unlock_irqrestore (&list->lock, flags); }EXPORT_SYMBOL (skb_queue_purge);
Signature · 1 line
2.14.1