提交 62208f12 编写于 作者: D Daniel Borkmann 提交者: David S. Miller

net: sctp: simplify sctp_get_port

No need to have an extra ret variable when we directly can return
the value of sctp_get_port_local().
Signed-off-by: NDaniel Borkmann <dborkman@redhat.com>
Acked-by: NVlad Yasevich <vyasevich@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 0a2fbac1
...@@ -6036,7 +6036,6 @@ static long sctp_get_port_local(struct sock *sk, union sctp_addr *addr) ...@@ -6036,7 +6036,6 @@ static long sctp_get_port_local(struct sock *sk, union sctp_addr *addr)
*/ */
static int sctp_get_port(struct sock *sk, unsigned short snum) static int sctp_get_port(struct sock *sk, unsigned short snum)
{ {
long ret;
union sctp_addr addr; union sctp_addr addr;
struct sctp_af *af = sctp_sk(sk)->pf->af; struct sctp_af *af = sctp_sk(sk)->pf->af;
...@@ -6045,9 +6044,7 @@ static int sctp_get_port(struct sock *sk, unsigned short snum) ...@@ -6045,9 +6044,7 @@ static int sctp_get_port(struct sock *sk, unsigned short snum)
addr.v4.sin_port = htons(snum); addr.v4.sin_port = htons(snum);
/* Note: sk->sk_num gets filled in if ephemeral port request. */ /* Note: sk->sk_num gets filled in if ephemeral port request. */
ret = sctp_get_port_local(sk, &addr); return !!sctp_get_port_local(sk, &addr);
return ret ? 1 : 0;
} }
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册