diff options
author | Alexander Duyck <alexander.h.duyck@intel.com> | 2014-09-04 13:32:11 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-09-05 20:43:45 -0400 |
commit | 82eabd9eb2ec1603282a2c3f74dfcb6fe0aaea0e (patch) | |
tree | 3f1064b6b501005f741bacc74e9ed370c2ffb996 /net/core/sock.c | |
parent | 62bccb8cdb69051b95a55ab0c489e3cab261c8ef (diff) |
net: merge cases where sock_efree and sock_edemux are the same function
Since sock_efree and sock_demux are essentially the same code for non-TCP
sockets and the case where CONFIG_INET is not defined we can combine the
code or replace the call to sock_edemux in several spots. As a result we
can avoid a bit of unnecessary code or code duplication.
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/sock.c')
-rw-r--r-- | net/core/sock.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/core/sock.c b/net/core/sock.c index d04005c51724..69592cb66e3b 100644 --- a/net/core/sock.c +++ b/net/core/sock.c | |||
@@ -1643,18 +1643,18 @@ void sock_efree(struct sk_buff *skb) | |||
1643 | } | 1643 | } |
1644 | EXPORT_SYMBOL(sock_efree); | 1644 | EXPORT_SYMBOL(sock_efree); |
1645 | 1645 | ||
1646 | #ifdef CONFIG_INET | ||
1646 | void sock_edemux(struct sk_buff *skb) | 1647 | void sock_edemux(struct sk_buff *skb) |
1647 | { | 1648 | { |
1648 | struct sock *sk = skb->sk; | 1649 | struct sock *sk = skb->sk; |
1649 | 1650 | ||
1650 | #ifdef CONFIG_INET | ||
1651 | if (sk->sk_state == TCP_TIME_WAIT) | 1651 | if (sk->sk_state == TCP_TIME_WAIT) |
1652 | inet_twsk_put(inet_twsk(sk)); | 1652 | inet_twsk_put(inet_twsk(sk)); |
1653 | else | 1653 | else |
1654 | #endif | ||
1655 | sock_put(sk); | 1654 | sock_put(sk); |
1656 | } | 1655 | } |
1657 | EXPORT_SYMBOL(sock_edemux); | 1656 | EXPORT_SYMBOL(sock_edemux); |
1657 | #endif | ||
1658 | 1658 | ||
1659 | kuid_t sock_i_uid(struct sock *sk) | 1659 | kuid_t sock_i_uid(struct sock *sk) |
1660 | { | 1660 | { |