Message ID | 20241110005927.30688-1-wmokhlef@gmail.com (mailing list archive) |
---|---|
State | Changes Requested |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [net-next] net/unix: Stylistic changes in diag.c | expand |
On Sun, 10 Nov 2024 01:59:20 +0100 William@web.codeaurora.org, Mokhlef@web.codeaurora.org, wmokhlef@gmail.com wrote: > From: William Mokhlef <wmokhlef@gmail.com> > > Changes based on the script scripts/checkpatch.pl > > Remove space after cast, blank line after declaration, > fixed brace style Quoting documentation: Clean-up patches ~~~~~~~~~~~~~~~~ Netdev discourages patches which perform simple clean-ups, which are not in the context of other work. For example: * Addressing ``checkpatch.pl`` warnings * Addressing :ref:`Local variable ordering<rcs>` issues * Conversions to device-managed APIs (``devm_`` helpers) This is because it is felt that the churn that such changes produce comes at a greater cost than the value of such clean-ups. Conversely, spelling and grammar fixes are not discouraged. See: https://www.kernel.org/doc/html/next/process/maintainer-netdev.html#clean-up-patches
diff --git a/net/unix/diag.c b/net/unix/diag.c index 9138af8b465e..94d4d273f7f4 100644 --- a/net/unix/diag.c +++ b/net/unix/diag.c @@ -94,8 +94,8 @@ static int sk_diag_show_rqlen(struct sock *sk, struct sk_buff *nlskb) rql.udiag_rqueue = skb_queue_len_lockless(&sk->sk_receive_queue); rql.udiag_wqueue = sk->sk_max_ack_backlog; } else { - rql.udiag_rqueue = (u32) unix_inq_len(sk); - rql.udiag_wqueue = (u32) unix_outq_len(sk); + rql.udiag_rqueue = (u32)unix_inq_len(sk); + rql.udiag_wqueue = (u32)unix_outq_len(sk); } return nla_put(nlskb, UNIX_DIAG_RQLEN, sizeof(rql), &rql); @@ -105,6 +105,7 @@ static int sk_diag_dump_uid(struct sock *sk, struct sk_buff *nlskb, struct user_namespace *user_ns) { uid_t uid = from_kuid_munged(user_ns, sock_i_uid(sk)); + return nla_put(nlskb, UNIX_DIAG_UID, sizeof(uid_t), &uid); } @@ -250,7 +251,7 @@ static int unix_diag_get_exact(struct sk_buff *in_skb, sk = unix_lookup_by_ino(net, req->udiag_ino); err = -ENOENT; - if (sk == NULL) + if (!sk) goto out_nosk; err = sock_diag_check_cookie(sk, req->udiag_cookie); @@ -296,8 +297,9 @@ static int unix_diag_handler_dump(struct sk_buff *skb, struct nlmsghdr *h) .dump = unix_diag_dump, }; return netlink_dump_start(sock_net(skb->sk)->diag_nlsk, skb, h, &c); - } else + } else { return unix_diag_get_exact(skb, h, nlmsg_data(h)); + } } static const struct sock_diag_handler unix_diag_handler = {
From: William Mokhlef <wmokhlef@gmail.com> Changes based on the script scripts/checkpatch.pl Remove space after cast, blank line after declaration, fixed brace style --- net/unix/diag.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)