]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
af_unix: Remove unix_our_peer().
authorKuniyuki Iwashima <kuniyu@amazon.com>
Fri, 13 Dec 2024 11:08:50 +0000 (20:08 +0900)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 17 Dec 2024 11:08:28 +0000 (12:08 +0100)
unix_our_peer() is used only in unix_may_send().

Let's inline it in unix_may_send().

Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
net/unix/af_unix.c

index 239ce2f77d553cfd472fd52d0c79256738403beb..8f2b605ce5b3754baec7ddf62f8197bfcb845865 100644 (file)
@@ -286,14 +286,9 @@ static inline bool unix_secdata_eq(struct scm_cookie *scm, struct sk_buff *skb)
 }
 #endif /* CONFIG_SECURITY_NETWORK */
 
-static inline int unix_our_peer(struct sock *sk, struct sock *osk)
-{
-       return unix_peer(osk) == sk;
-}
-
 static inline int unix_may_send(struct sock *sk, struct sock *osk)
 {
-       return unix_peer(osk) == NULL || unix_our_peer(sk, osk);
+       return !unix_peer(osk) || unix_peer(osk) == sk;
 }
 
 static inline int unix_recvq_full_lockless(const struct sock *sk)