diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2023-01-11 08:49:57 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2023-01-11 08:58:10 +0100 |
commit | 484b12f6694dfa23d14a4db30971914e8b44fbf7 (patch) | |
tree | 1ab4cf373d42f7ed4ba2b6bd4334115b6363620f /include | |
parent | bc7b2e113318807a1003afaf419e8949a8fcc4dd (diff) | |
download | barebox-484b12f6694dfa23d14a4db30971914e8b44fbf7.tar.gz |
include: linux/iopoll.h: silence warning when timeout_us contains *
We evaluate timeout_us for truthiness to determine whether we are
entering an infinite poll loop. When timeout_us contains a
multiplication, GCC will warn about it and suggest replacing the *
with &&. Silence this warning by comparing directly against 0.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20230111074957.897629-1-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/iopoll.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/iopoll.h b/include/linux/iopoll.h index 8bf912e173..96b17dee48 100644 --- a/include/linux/iopoll.h +++ b/include/linux/iopoll.h @@ -32,13 +32,13 @@ #define read_poll_timeout(op, val, cond, timeout_us, args...) \ ({ \ uint64_t start; \ - if (!IN_PBL && timeout_us) \ + if (!IN_PBL && (timeout_us) != 0) \ start = get_time_ns(); \ for (;;) { \ (val) = op(args); \ if (cond) \ break; \ - if (!IN_PBL && timeout_us && \ + if (!IN_PBL && (timeout_us) != 0 && \ is_timeout(start, ((timeout_us) * USECOND))) { \ (val) = op(args); \ break; \ |