diff options
author | Mark Brown <broonie@linaro.org> | 2014-07-01 11:20:17 +0100 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-07-01 11:20:17 +0100 |
commit | 80f04edd1db9e64fc5310130b9b2c95b965ec9c9 (patch) | |
tree | e11c306c70eda44b6a893b42d04d2bcc6e991249 /include/net/inetpeer.h | |
parent | ab58e812c6d8def5fce2763fc7fdda3751047beb (diff) | |
parent | bbae7add628cfe96a1facd578dd1eddcd1030de7 (diff) |
Merge tag 'v3.14.10' into linux-linaro-lsk-v3.14
This is the 3.14.10 stable release
Diffstat (limited to 'include/net/inetpeer.h')
-rw-r--r-- | include/net/inetpeer.h | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/include/net/inetpeer.h b/include/net/inetpeer.h index 6efe73c79c52..058271bde27a 100644 --- a/include/net/inetpeer.h +++ b/include/net/inetpeer.h @@ -177,16 +177,9 @@ static inline void inet_peer_refcheck(const struct inet_peer *p) /* can be called with or without local BH being disabled */ static inline int inet_getid(struct inet_peer *p, int more) { - int old, new; more++; inet_peer_refcheck(p); - do { - old = atomic_read(&p->ip_id_count); - new = old + more; - if (!new) - new = 1; - } while (atomic_cmpxchg(&p->ip_id_count, old, new) != old); - return new; + return atomic_add_return(more, &p->ip_id_count) - more; } #endif /* _NET_INETPEER_H */ |