mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Joshua Crofts <joshua.crofts1@gmail.com>
Cc: Maria Sheikh <mariasheikh812@gmail.com>,
	outreachy@lists.linux.dev, nuno.sa@analog.com,
	Michael.Hennerich@analog.com, 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: Sat, 7 Nov 2026 22:31:56 +0000	[thread overview]
Message-ID: <20261107223156.7d64b095@jic23-hlaptop> (raw)
In-Reply-To: <20261104090008.00002b25@gmail.com>

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

> On Wed,  4 Nov 2026 09:10:45 +0500
> Maria Sheikh <mariasheikh812@gmail.com> 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@kernel.org>
> 

      reply	other threads:[~2026-11-07 22:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-04  4:10 Maria Sheikh
2026-11-04  7:47 ` Dan Carpenter
2026-11-04  8:00 ` Joshua Crofts
2026-11-07 22:31   ` Jonathan Cameron [this message]

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=20261107223156.7d64b095@jic23-hlaptop \
    --to=jic23@kernel.org \
    --cc=Michael.Hennerich@analog.com \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=joshua.crofts1@gmail.com \
    --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®