kernel/poll: refactor is_polling()

It's always called for the current thread.

Change-Id: I6588ae27505e961df5cf82463ca9be90a539685b
Signed-off-by: Benjamin Walsh <walsh.benj@gmail.com>
This commit is contained in:
Benjamin Walsh 2017-02-09 14:52:21 -05:00 committed by Anas Nashif
commit 47503e30b2

View file

@ -52,9 +52,9 @@ static inline void clear_polling_state(struct k_thread *thread)
}
/* must be called with interrupts locked */
static inline int is_polling(struct k_thread *thread)
static inline int is_polling(void)
{
return _is_thread_polling(thread);
return _is_thread_polling(_current);
}
/* must be called with interrupts locked */
@ -230,7 +230,7 @@ int k_poll(struct k_poll_event *events, int num_events, int32_t timeout)
* valid for the caller to consider them available, as if this function
* returned success.
*/
if (!is_polling(_current)) {
if (!is_polling()) {
clear_event_registrations(events, last_registered, key);
irq_unlock(key);
return in_use;