diff mbox series

[net-next] netlink: add spaces around '&' in netlink_recvmsg()

Message ID 20200907132144.3144704-1-yangyingliang@huawei.com
State Changes Requested
Delegated to: David Miller
Headers show
Series [net-next] netlink: add spaces around '&' in netlink_recvmsg() | expand

Commit Message

Yang Yingliang Sept. 7, 2020, 1:21 p.m. UTC
Spaces preferred around '&'.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
 net/netlink/af_netlink.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Jakub Kicinski Sept. 7, 2020, 8:51 p.m. UTC | #1
On Mon, 7 Sep 2020 21:21:44 +0800 Yang Yingliang wrote:
> Spaces preferred around '&'.

This in itself is not a sufficient justification to touch code that
pre-dates the git era.

IMHO '&' without spaces around it is particularly hard to read, and 
the code is actively used, which makes the change worth considering.

But I'm not sure why you decided to fix recvmsg but not sendmsg.

Please provide a better commit message.

> diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
> index d2d1448274f5..5a86bf4f80b1 100644
> --- a/net/netlink/af_netlink.c
> +++ b/net/netlink/af_netlink.c
> @@ -1929,12 +1929,12 @@ static int netlink_recvmsg(struct socket *sock, struct msghdr *msg, size_t len,
>  	struct scm_cookie scm;
>  	struct sock *sk = sock->sk;
>  	struct netlink_sock *nlk = nlk_sk(sk);
> -	int noblock = flags&MSG_DONTWAIT;
> +	int noblock = flags & MSG_DONTWAIT;
>  	size_t copied;
>  	struct sk_buff *skb, *data_skb;
>  	int err, ret;
>  
> -	if (flags&MSG_OOB)
> +	if (flags & MSG_OOB)
>  		return -EOPNOTSUPP;
>  
>  	copied = 0;
diff mbox series

Patch

diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index d2d1448274f5..5a86bf4f80b1 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -1929,12 +1929,12 @@  static int netlink_recvmsg(struct socket *sock, struct msghdr *msg, size_t len,
 	struct scm_cookie scm;
 	struct sock *sk = sock->sk;
 	struct netlink_sock *nlk = nlk_sk(sk);
-	int noblock = flags&MSG_DONTWAIT;
+	int noblock = flags & MSG_DONTWAIT;
 	size_t copied;
 	struct sk_buff *skb, *data_skb;
 	int err, ret;
 
-	if (flags&MSG_OOB)
+	if (flags & MSG_OOB)
 		return -EOPNOTSUPP;
 
 	copied = 0;