Re: [PATCH] staging: iio: addac: adt7316: return 0 in _adt7316_store_enabled

From: Jonathan Cameron

Date: Sat Nov 07 2026 - 17:32:12 EST


On Wed, 4 Nov 2026 09:00:08 +0100
Joshua Crofts <joshua.crofts1@xxxxxxxxx> wrote:

> On Wed, 4 Nov 2026 09:10:45 +0500
> Maria Sheikh <mariasheikh812@xxxxxxxxx> wrote:
>
> > _adt7316_store_enabled() writes the config register and returns -EIO if
> > the write fails. When execution reaches the final "return ret;", the
> > write has succeeded, so ret is always 0. Return 0 directly to make the
> > success path obvious.
> >
> > Found with cppcheck (identicalConditionAfterEarlyExit). All callers
> > either check for a negative return value or pass it through, so
> > behavior does not change.
> >
> > Compile-tested with W=1. The disassembly of adt7316.o is identical
> > before and after this change.
>
> I'd move the testing info below the ---, as it's only compile tested.
> No need to resend however, this can be fixed up when applying.
>
Done whilst applying.

Applied to the testing branch of iio.git

thanks,

Jonathan

> Reviewed-by: Joshua Crofts <crofts@xxxxxxxxxx>
>