aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include
diff options
context:
space:
mode:
authorDejin Zheng <zhengdejin5@gmail.com>2020-03-23 23:05:52 +0800
committerDavid S. Miller <davem@davemloft.net>2020-03-23 22:00:02 -0700
commiteaa6b01024a74ab5f3064f17dd88596284f497c4 (patch)
tree380df6b4f0e9cf94657d21caf123e41369c5c16e /include
parentiopoll: introduce read_poll_timeout macro (diff)
downloadwireguard-linux-eaa6b01024a74ab5f3064f17dd88596284f497c4.tar.xz
wireguard-linux-eaa6b01024a74ab5f3064f17dd88596284f497c4.zip
iopoll: redefined readx_poll_timeout macro to simplify the code
redefined readx_poll_timeout macro by read_poll_timeout to simplify the code. Signed-off-by: Dejin Zheng <zhengdejin5@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/linux/iopoll.h20
1 files changed, 1 insertions, 19 deletions
diff --git a/include/linux/iopoll.h b/include/linux/iopoll.h
index 70f89b389648..cb20c733b15a 100644
--- a/include/linux/iopoll.h
+++ b/include/linux/iopoll.h
@@ -76,25 +76,7 @@
* macros defined below rather than this macro directly.
*/
#define readx_poll_timeout(op, addr, val, cond, sleep_us, timeout_us) \
-({ \
- u64 __timeout_us = (timeout_us); \
- unsigned long __sleep_us = (sleep_us); \
- ktime_t __timeout = ktime_add_us(ktime_get(), __timeout_us); \
- might_sleep_if((__sleep_us) != 0); \
- for (;;) { \
- (val) = op(addr); \
- if (cond) \
- break; \
- if (__timeout_us && \
- ktime_compare(ktime_get(), __timeout) > 0) { \
- (val) = op(addr); \
- break; \
- } \
- if (__sleep_us) \
- usleep_range((__sleep_us >> 2) + 1, __sleep_us); \
- } \
- (cond) ? 0 : -ETIMEDOUT; \
-})
+ read_poll_timeout(op, val, cond, sleep_us, timeout_us, false, addr)
/**
* readx_poll_timeout_atomic - Periodically poll an address until a condition is met or a timeout occurs