lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241110005927.30688-1-wmokhlef@gmail.com>
Date: Sun, 10 Nov 2024 01:59:20 +0100
From: William@....codeaurora.org, Mokhlef@....codeaurora.org,
	wmokhlef@...il.com
To: davem@...emloft.net
Cc: netdev@...r.kernel.org,
	trivial@...nel.org,
	William Mokhlef <wmokhlef@...il.com>
Subject: [PATCH net-next] net/unix: Stylistic changes in diag.c

From: William Mokhlef <wmokhlef@...il.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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ