mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2] iio: addac: ad74413r: simplify timeout return
@ 2026-02-23 10:14 Antoniu Miclaus
  2026-02-23 10:34 ` Andy Shevchenko
  0 siblings, 1 reply; 3+ messages in thread
From: Antoniu Miclaus @ 2026-02-23 10:14 UTC (permalink / raw)
  To: Cosmin Tanislav, Lars-Peter Clausen, Michael Hennerich,
	Jonathan Cameron, David Lechner, Nuno Sá,
	Andy Shevchenko, linux-iio, linux-kernel
  Cc: Antoniu Miclaus

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] iio: addac: ad74413r: simplify timeout return
  2026-02-23 10:14 [PATCH v2] iio: addac: ad74413r: simplify timeout return Antoniu Miclaus
@ 2026-02-23 10:34 ` Andy Shevchenko
  2026-02-23 21:22   ` Jonathan Cameron
  0 siblings, 1 reply; 3+ messages in thread
From: Andy Shevchenko @ 2026-02-23 10:34 UTC (permalink / raw)
  To: Antoniu Miclaus
  Cc: Cosmin Tanislav, Lars-Peter Clausen, Michael Hennerich,
	Jonathan Cameron, David Lechner, Nuno Sá,
	Andy Shevchenko, linux-iio, linux-kernel

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] iio: addac: ad74413r: simplify timeout return
  2026-02-23 10:34 ` Andy Shevchenko
@ 2026-02-23 21:22   ` Jonathan Cameron
  0 siblings, 0 replies; 3+ messages in thread
From: Jonathan Cameron @ 2026-02-23 21:22 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Antoniu Miclaus, Cosmin Tanislav, Lars-Peter Clausen,
	Michael Hennerich, David Lechner, Nuno Sá,
	Andy Shevchenko, linux-iio, linux-kernel

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-02-23 21:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-02-23 10:14 [PATCH v2] iio: addac: ad74413r: simplify timeout return Antoniu Miclaus
2026-02-23 10:34 ` Andy Shevchenko
2026-02-23 21:22   ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®