aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/datagram.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2017-07-03 20:14:56 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2017-11-27 16:19:54 -0500
commit3ad6f93e98d6df25d0667d847d3ab9cbdccb3eae (patch)
tree8b52d66806f02c815198e962758ac4199d9ee6e0 /net/core/datagram.c
parentanntotate the places where ->poll() return values go (diff)
downloadlinux-dev-3ad6f93e98d6df25d0667d847d3ab9cbdccb3eae.tar.xz
linux-dev-3ad6f93e98d6df25d0667d847d3ab9cbdccb3eae.zip
annotate poll-related wait keys
__poll_t is also used as wait key in some waitqueues. Verify that wait_..._poll() gets __poll_t as key and provide a helper for wakeup functions to get back to that __poll_t value. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'net/core/datagram.c')
-rw-r--r--net/core/datagram.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/net/core/datagram.c b/net/core/datagram.c
index 522873ed120b..000da13c01f2 100644
--- a/net/core/datagram.c
+++ b/net/core/datagram.c
@@ -72,12 +72,10 @@ static inline int connection_based(struct sock *sk)
static int receiver_wake_function(wait_queue_entry_t *wait, unsigned int mode, int sync,
void *key)
{
- unsigned long bits = (unsigned long)key;
-
/*
* Avoid a wakeup if event not interesting for us
*/
- if (bits && !(bits & (POLLIN | POLLERR)))
+ if (key && !(key_to_poll(key) & (POLLIN | POLLERR)))
return 0;
return autoremove_wake_function(wait, mode, sync, key);
}