projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0a2fbac
)
net: sctp: simplify sctp_get_port
author
Daniel Borkmann
<
[email protected]
>
Tue, 25 Jun 2013 16:17:30 +0000
(18:17 +0200)
committer
David S. Miller
<
[email protected]
>
Tue, 25 Jun 2013 23:33:05 +0000
(16:33 -0700)
No need to have an extra ret variable when we directly can return
the value of sctp_get_port_local().
Signed-off-by: Daniel Borkmann <
[email protected]
>
Acked-by: Vlad Yasevich <
[email protected]
>
Signed-off-by: David S. Miller <
[email protected]
>
net/sctp/socket.c
patch
|
blob
|
history
diff --git
a/net/sctp/socket.c
b/net/sctp/socket.c
index ba9359c20c8ab2811185b7a0cba9d6858da705a9..66fcdcfe1b7441a135f2eb95cf5b27ab1de6d054 100644
(file)
--- a/
net/sctp/socket.c
+++ b/
net/sctp/socket.c
@@
-6036,7
+6036,6
@@
fail:
*/
static int sctp_get_port(struct sock *sk, unsigned short snum)
{
- long ret;
union sctp_addr addr;
struct sctp_af *af = sctp_sk(sk)->pf->af;
@@
-6045,9
+6044,7
@@
static int sctp_get_port(struct sock *sk, unsigned short snum)
addr.v4.sin_port = htons(snum);
/* Note: sk->sk_num gets filled in if ephemeral port request. */
- ret = sctp_get_port_local(sk, &addr);
-
- return ret ? 1 : 0;
+ return !!sctp_get_port_local(sk, &addr);
}
/*