Commit 7180a03118cac7256fb04f929fe34d0aeee92c40
Committed by
David S. Miller
1 parent
b8970f0bfc
Exists in
master
and in
39 other branches
af_unix: coding style: remove one level of indentation in unix_shutdown()
Signed-off-by: Alban Crequy <alban.crequy@collabora.co.uk> Reviewed-by: Ian Molton <ian.molton@collabora.co.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
Showing 1 changed file with 31 additions and 29 deletions Side-by-side Diff
net/unix/af_unix.c
... | ... | @@ -1984,36 +1984,38 @@ |
1984 | 1984 | |
1985 | 1985 | mode = (mode+1)&(RCV_SHUTDOWN|SEND_SHUTDOWN); |
1986 | 1986 | |
1987 | - if (mode) { | |
1988 | - unix_state_lock(sk); | |
1989 | - sk->sk_shutdown |= mode; | |
1990 | - other = unix_peer(sk); | |
1991 | - if (other) | |
1992 | - sock_hold(other); | |
1993 | - unix_state_unlock(sk); | |
1994 | - sk->sk_state_change(sk); | |
1987 | + if (!mode) | |
1988 | + return 0; | |
1995 | 1989 | |
1996 | - if (other && | |
1997 | - (sk->sk_type == SOCK_STREAM || sk->sk_type == SOCK_SEQPACKET)) { | |
1990 | + unix_state_lock(sk); | |
1991 | + sk->sk_shutdown |= mode; | |
1992 | + other = unix_peer(sk); | |
1993 | + if (other) | |
1994 | + sock_hold(other); | |
1995 | + unix_state_unlock(sk); | |
1996 | + sk->sk_state_change(sk); | |
1998 | 1997 | |
1999 | - int peer_mode = 0; | |
1998 | + if (other && | |
1999 | + (sk->sk_type == SOCK_STREAM || sk->sk_type == SOCK_SEQPACKET)) { | |
2000 | 2000 | |
2001 | - if (mode&RCV_SHUTDOWN) | |
2002 | - peer_mode |= SEND_SHUTDOWN; | |
2003 | - if (mode&SEND_SHUTDOWN) | |
2004 | - peer_mode |= RCV_SHUTDOWN; | |
2005 | - unix_state_lock(other); | |
2006 | - other->sk_shutdown |= peer_mode; | |
2007 | - unix_state_unlock(other); | |
2008 | - other->sk_state_change(other); | |
2009 | - if (peer_mode == SHUTDOWN_MASK) | |
2010 | - sk_wake_async(other, SOCK_WAKE_WAITD, POLL_HUP); | |
2011 | - else if (peer_mode & RCV_SHUTDOWN) | |
2012 | - sk_wake_async(other, SOCK_WAKE_WAITD, POLL_IN); | |
2013 | - } | |
2014 | - if (other) | |
2015 | - sock_put(other); | |
2001 | + int peer_mode = 0; | |
2002 | + | |
2003 | + if (mode&RCV_SHUTDOWN) | |
2004 | + peer_mode |= SEND_SHUTDOWN; | |
2005 | + if (mode&SEND_SHUTDOWN) | |
2006 | + peer_mode |= RCV_SHUTDOWN; | |
2007 | + unix_state_lock(other); | |
2008 | + other->sk_shutdown |= peer_mode; | |
2009 | + unix_state_unlock(other); | |
2010 | + other->sk_state_change(other); | |
2011 | + if (peer_mode == SHUTDOWN_MASK) | |
2012 | + sk_wake_async(other, SOCK_WAKE_WAITD, POLL_HUP); | |
2013 | + else if (peer_mode & RCV_SHUTDOWN) | |
2014 | + sk_wake_async(other, SOCK_WAKE_WAITD, POLL_IN); | |
2016 | 2015 | } |
2016 | + if (other) | |
2017 | + sock_put(other); | |
2018 | + | |
2017 | 2019 | return 0; |
2018 | 2020 | } |
2019 | 2021 |