summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2023-01-11 08:49:57 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2023-01-11 08:58:10 +0100
commit484b12f6694dfa23d14a4db30971914e8b44fbf7 (patch)
tree1ab4cf373d42f7ed4ba2b6bd4334115b6363620f /include/linux
parentbc7b2e113318807a1003afaf419e8949a8fcc4dd (diff)
downloadbarebox-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/linux')
-rw-r--r--include/linux/iopoll.h4
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; \