Skip to content

Commit 72193a9

Browse files
charleskeepaxbroonie
authored andcommitted
regmap: Rename ret variable in regmap_read_poll_timeout
As almost all of the callers of the regmap_read_poll_timeout macro will include a local ret variable we will always get a Sparse warning about the duplication of the ret variable: warning: symbol 'ret' shadows an earlier one Simply rename the ret variable in the marco to pollret to make this significantly less likely to happen. Signed-off-by: Charles Keepax <[email protected]> Signed-off-by: Mark Brown <[email protected]>
1 parent 1001354 commit 72193a9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

include/linux/regmap.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,22 +116,22 @@ struct reg_sequence {
116116
#define regmap_read_poll_timeout(map, addr, val, cond, sleep_us, timeout_us) \
117117
({ \
118118
ktime_t timeout = ktime_add_us(ktime_get(), timeout_us); \
119-
int ret; \
119+
int pollret; \
120120
might_sleep_if(sleep_us); \
121121
for (;;) { \
122-
ret = regmap_read((map), (addr), &(val)); \
123-
if (ret) \
122+
pollret = regmap_read((map), (addr), &(val)); \
123+
if (pollret) \
124124
break; \
125125
if (cond) \
126126
break; \
127127
if (timeout_us && ktime_compare(ktime_get(), timeout) > 0) { \
128-
ret = regmap_read((map), (addr), &(val)); \
128+
pollret = regmap_read((map), (addr), &(val)); \
129129
break; \
130130
} \
131131
if (sleep_us) \
132132
usleep_range((sleep_us >> 2) + 1, sleep_us); \
133133
} \
134-
ret ?: ((cond) ? 0 : -ETIMEDOUT); \
134+
pollret ?: ((cond) ? 0 : -ETIMEDOUT); \
135135
})
136136

137137
#ifdef CONFIG_REGMAP

0 commit comments

Comments
 (0)