diff mbox series

[net-next] net/unix: Stylistic changes in diag.c

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

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 3 this patch: 3
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers fail 5 maintainers not CCed: kuba@kernel.org kuniyu@amazon.com horms@kernel.org pabeni@redhat.com edumazet@google.com
netdev/build_clang success Errors and warnings before: 3 this patch: 3
netdev/verify_signedoff fail author Signed-off-by missing
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 4 this patch: 4
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 35 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-11-10--12-00 (tests: 785)

Commit Message

William Mokhlef wmokhlef@gmail.com Nov. 10, 2024, 12:59 a.m. UTC
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(-)

Comments

Jakub Kicinski Nov. 11, 2024, 6:50 p.m. UTC | #1
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 mbox series

Patch

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