Skip to content

Commit d85e2aa

Browse files
author
Al Viro
committed
annotate ep_scan_ready_list()
make it always return __poll_t and have its callbacks do the same Signed-off-by: Al Viro <[email protected]>
1 parent d7ebbe4 commit d85e2aa

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

fs/eventpoll.c

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -661,12 +661,13 @@ static inline void ep_pm_stay_awake_rcu(struct epitem *epi)
661661
*
662662
* Returns: The same integer error code returned by the @sproc callback.
663663
*/
664-
static int ep_scan_ready_list(struct eventpoll *ep,
665-
int (*sproc)(struct eventpoll *,
664+
static __poll_t ep_scan_ready_list(struct eventpoll *ep,
665+
__poll_t (*sproc)(struct eventpoll *,
666666
struct list_head *, void *),
667667
void *priv, int depth, bool ep_locked)
668668
{
669-
int error, pwake = 0;
669+
__poll_t res;
670+
int pwake = 0;
670671
unsigned long flags;
671672
struct epitem *epi, *nepi;
672673
LIST_HEAD(txlist);
@@ -695,7 +696,7 @@ static int ep_scan_ready_list(struct eventpoll *ep,
695696
/*
696697
* Now call the callback function.
697698
*/
698-
error = (*sproc)(ep, &txlist, priv);
699+
res = (*sproc)(ep, &txlist, priv);
699700

700701
spin_lock_irqsave(&ep->lock, flags);
701702
/*
@@ -748,7 +749,7 @@ static int ep_scan_ready_list(struct eventpoll *ep,
748749
if (pwake)
749750
ep_poll_safewake(&ep->poll_wait);
750751

751-
return error;
752+
return res;
752753
}
753754

754755
static void epi_rcu_free(struct rcu_head *head)
@@ -865,7 +866,7 @@ static int ep_eventpoll_release(struct inode *inode, struct file *file)
865866
return 0;
866867
}
867868

868-
static int ep_read_events_proc(struct eventpoll *ep, struct list_head *head,
869+
static __poll_t ep_read_events_proc(struct eventpoll *ep, struct list_head *head,
869870
void *priv);
870871
static void ep_ptable_queue_proc(struct file *file, wait_queue_head_t *whead,
871872
poll_table *pt);
@@ -875,7 +876,7 @@ static void ep_ptable_queue_proc(struct file *file, wait_queue_head_t *whead,
875876
* the ep->mtx so we need to start from depth=1, such that mutex_lock_nested()
876877
* is correctly annotated.
877878
*/
878-
static unsigned int ep_item_poll(const struct epitem *epi, poll_table *pt,
879+
static __poll_t ep_item_poll(const struct epitem *epi, poll_table *pt,
879880
int depth)
880881
{
881882
struct eventpoll *ep;
@@ -895,7 +896,7 @@ static unsigned int ep_item_poll(const struct epitem *epi, poll_table *pt,
895896
locked) & epi->event.events;
896897
}
897898

898-
static int ep_read_events_proc(struct eventpoll *ep, struct list_head *head,
899+
static __poll_t ep_read_events_proc(struct eventpoll *ep, struct list_head *head,
899900
void *priv)
900901
{
901902
struct epitem *epi, *tmp;
@@ -1415,7 +1416,8 @@ static noinline void ep_destroy_wakeup_source(struct epitem *epi)
14151416
static int ep_insert(struct eventpoll *ep, const struct epoll_event *event,
14161417
struct file *tfile, int fd, int full_check)
14171418
{
1418-
int error, revents, pwake = 0;
1419+
int error, pwake = 0;
1420+
__poll_t revents;
14191421
unsigned long flags;
14201422
long user_watches;
14211423
struct epitem *epi;
@@ -1613,11 +1615,11 @@ static int ep_modify(struct eventpoll *ep, struct epitem *epi,
16131615
return 0;
16141616
}
16151617

1616-
static int ep_send_events_proc(struct eventpoll *ep, struct list_head *head,
1618+
static __poll_t ep_send_events_proc(struct eventpoll *ep, struct list_head *head,
16171619
void *priv)
16181620
{
16191621
struct ep_send_events_data *esed = priv;
1620-
unsigned int revents;
1622+
__poll_t revents;
16211623
struct epitem *epi;
16221624
struct epoll_event __user *uevent;
16231625
struct wakeup_source *ws;

0 commit comments

Comments
 (0)