From: Dan Carpenter <error27@gmail.com>
To: Maria Sheikh <mariasheikh812@gmail.com>
Cc: outreachy@lists.linux.dev, nuno.sa@analog.com,
Michael.Hennerich@analog.com, jic23@kernel.org,
dlechner@baylibre.com, andy@kernel.org,
gregkh@linuxfoundation.org, linux@analog.com,
linux-iio@vger.kernel.org, linux-staging@lists.linux.dev,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: iio: addac: adt7316: return 0 in _adt7316_store_enabled
Date: Wed, 4 Nov 2026 10:47:19 +0300 [thread overview]
Message-ID: <aurjB1B5sRHC6GsW@stanley.mountain> (raw)
In-Reply-To: <20261104041237.7978-1-mariasheikh812@gmail.com>
On Wed, Nov 04, 2026 at 09:10:45AM +0500, Maria Sheikh 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.
>
> Signed-off-by: Maria Sheikh <mariasheikh812@gmail.com>
> ---
Reviewed-by: Dan Carpenter <error27@gmail.com>
regards,
dan carpenter
next prev parent reply other threads:[~2026-11-04 7:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-04 4:10 Maria Sheikh
2026-11-04 7:47 ` Dan Carpenter [this message]
2026-11-04 8:00 ` Joshua Crofts
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aurjB1B5sRHC6GsW@stanley.mountain \
--to=error27@gmail.com \
--cc=Michael.Hennerich@analog.com \
--cc=andy@kernel.org \
--cc=dlechner@baylibre.com \
--cc=gregkh@linuxfoundation.org \
--cc=jic23@kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=linux@analog.com \
--cc=mariasheikh812@gmail.com \
--cc=nuno.sa@analog.com \
--cc=outreachy@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®