drivers/iio/addac/ad74413r.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
Return -ETIMEDOUT directly instead of assigning it to an intermediate
variable first.
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
---
Changes in v2:
- Use wait_for_completion_timeout() directly in if condition
instead of assigning to ret first.
drivers/iio/addac/ad74413r.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/iio/addac/ad74413r.c b/drivers/iio/addac/ad74413r.c
index a20b4d48c5f7..fe930ce5ee30 100644
--- a/drivers/iio/addac/ad74413r.c
+++ b/drivers/iio/addac/ad74413r.c
@@ -839,12 +839,9 @@ static int _ad74413r_get_single_adc_result(struct ad74413r_state *st,
if (ret)
return ret;
- ret = wait_for_completion_timeout(&st->adc_data_completion,
- msecs_to_jiffies(1000));
- if (!ret) {
- ret = -ETIMEDOUT;
- return ret;
- }
+ if (!wait_for_completion_timeout(&st->adc_data_completion,
+ msecs_to_jiffies(1000)))
+ return -ETIMEDOUT;
ret = regmap_read(st->regmap, AD74413R_REG_ADC_RESULT_X(channel),
&uval);
--
2.43.0
On Mon, Feb 23, 2026 at 12:15 PM Antoniu Miclaus <antoniu.miclaus@analog.com> wrote: > > Return -ETIMEDOUT directly instead of assigning it to an intermediate > variable first. Reviewed-by: Andy Shevchenko <andy@kernel.org> -- With Best Regards, Andy Shevchenko
On Mon, 23 Feb 2026 12:34:08 +0200 Andy Shevchenko <andy.shevchenko@gmail.com> wrote: > On Mon, Feb 23, 2026 at 12:15 PM Antoniu Miclaus > <antoniu.miclaus@analog.com> wrote: > > > > Return -ETIMEDOUT directly instead of assigning it to an intermediate > > variable first. > > Reviewed-by: Andy Shevchenko <andy@kernel.org> > Applied. Ta J
© 2016 - 2026 Red Hat, Inc.