netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net/unix: Stylistic changes in diag.c
@ 2024-11-10  0:59 William
  2024-11-11 18:50 ` Jakub Kicinski
  0 siblings, 1 reply; 2+ messages in thread
From: William @ 2024-11-10  0:59 UTC (permalink / raw)
  To: davem; +Cc: netdev, trivial, William Mokhlef

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

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 = {
-- 
2.42.0


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

end of thread, other threads:[~2024-11-11 18:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-10  0:59 [PATCH net-next] net/unix: Stylistic changes in diag.c William
2024-11-11 18:50 ` Jakub Kicinski

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