diff options
author | Charles Keepax <ckeepax@opensource.wolfsonmicro.com> | 2016-10-28 06:38:53 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-10-28 13:19:24 -0400 |
commit | 72193a953ada9058e46970838cc42cbd18bf4eba (patch) | |
tree | 5c3beb6980a8edf27d1311d5537f23df2475ffb8 | |
parent | 1001354ca34179f3db924eb66672442a173147dc (diff) |
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 <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | include/linux/regmap.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/include/linux/regmap.h b/include/linux/regmap.h index 9adc7b21903d..fc9e3c576f9c 100644 --- a/include/linux/regmap.h +++ b/include/linux/regmap.h | |||
@@ -116,22 +116,22 @@ struct reg_sequence { | |||
116 | #define regmap_read_poll_timeout(map, addr, val, cond, sleep_us, timeout_us) \ | 116 | #define regmap_read_poll_timeout(map, addr, val, cond, sleep_us, timeout_us) \ |
117 | ({ \ | 117 | ({ \ |
118 | ktime_t timeout = ktime_add_us(ktime_get(), timeout_us); \ | 118 | ktime_t timeout = ktime_add_us(ktime_get(), timeout_us); \ |
119 | int ret; \ | 119 | int pollret; \ |
120 | might_sleep_if(sleep_us); \ | 120 | might_sleep_if(sleep_us); \ |
121 | for (;;) { \ | 121 | for (;;) { \ |
122 | ret = regmap_read((map), (addr), &(val)); \ | 122 | pollret = regmap_read((map), (addr), &(val)); \ |
123 | if (ret) \ | 123 | if (pollret) \ |
124 | break; \ | 124 | break; \ |
125 | if (cond) \ | 125 | if (cond) \ |
126 | break; \ | 126 | break; \ |
127 | if (timeout_us && ktime_compare(ktime_get(), timeout) > 0) { \ | 127 | if (timeout_us && ktime_compare(ktime_get(), timeout) > 0) { \ |
128 | ret = regmap_read((map), (addr), &(val)); \ | 128 | pollret = regmap_read((map), (addr), &(val)); \ |
129 | break; \ | 129 | break; \ |
130 | } \ | 130 | } \ |
131 | if (sleep_us) \ | 131 | if (sleep_us) \ |
132 | usleep_range((sleep_us >> 2) + 1, sleep_us); \ | 132 | usleep_range((sleep_us >> 2) + 1, sleep_us); \ |
133 | } \ | 133 | } \ |
134 | ret ?: ((cond) ? 0 : -ETIMEDOUT); \ | 134 | pollret ?: ((cond) ? 0 : -ETIMEDOUT); \ |
135 | }) | 135 | }) |
136 | 136 | ||
137 | #ifdef CONFIG_REGMAP | 137 | #ifdef CONFIG_REGMAP |