diff options
author | Sebastian Reichel <sebastian.reichel@collabora.com> | 2020-05-10 01:56:03 +0200 |
---|---|---|
committer | Sebastian Reichel <sebastian.reichel@collabora.com> | 2020-05-10 01:56:03 +0200 |
commit | bf584e4dbd5bac7b1aaddbd33a7116364f919819 (patch) | |
tree | 1a4ebb22e283da0b363d9ad497f11624a2f4f439 /net/ipv6/ipv6_sockglue.c | |
parent | power: reset: ltc2952: remove unused variable (diff) | |
parent | regulator: use linear_ranges helper (diff) | |
download | linux-bf584e4dbd5bac7b1aaddbd33a7116364f919819.tar.xz linux-bf584e4dbd5bac7b1aaddbd33a7116364f919819.zip |
Merge tag 'tags/linear-ranges-lib' into psy-next
lib: Add linear ranges helper library and start using it
Series extracts a "linear ranges" helper out of the regulator
framework. Linear ranges helper is intended to help converting
real-world values to register values when conversion is linear. I
suspect this is useful also for power subsystem and possibly for clk.
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Diffstat (limited to 'net/ipv6/ipv6_sockglue.c')
-rw-r--r-- | net/ipv6/ipv6_sockglue.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c index debdaeba5d8c..18d05403d3b5 100644 --- a/net/ipv6/ipv6_sockglue.c +++ b/net/ipv6/ipv6_sockglue.c @@ -183,15 +183,14 @@ static int do_ipv6_setsockopt(struct sock *sk, int level, int optname, retv = -EBUSY; break; } - } else if (sk->sk_protocol == IPPROTO_TCP) { - if (sk->sk_prot != &tcpv6_prot) { - retv = -EBUSY; - break; - } - break; - } else { + } + if (sk->sk_protocol == IPPROTO_TCP && + sk->sk_prot != &tcpv6_prot) { + retv = -EBUSY; break; } + if (sk->sk_protocol != IPPROTO_TCP) + break; if (sk->sk_state != TCP_ESTABLISHED) { retv = -ENOTCONN; break; |