mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Maria Sheikh <mariasheikh812@gmail.com>
To: 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
Cc: Maria Sheikh <mariasheikh812@gmail.com>
Subject: [PATCH] staging: iio: addac: adt7316: return 0 in _adt7316_store_enabled
Date: Wed,  4 Nov 2026 09:10:45 +0500	[thread overview]
Message-ID: <20261104041237.7978-1-mariasheikh812@gmail.com> (raw)

_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>
---
 drivers/staging/iio/addac/adt7316.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/iio/addac/adt7316.c b/drivers/staging/iio/addac/adt7316.c
index 20f6052cc7fb..4cb03e7808ab 100644
--- a/drivers/staging/iio/addac/adt7316.c
+++ b/drivers/staging/iio/addac/adt7316.c
@@ -236,7 +236,7 @@ static ssize_t _adt7316_store_enabled(struct adt7316_chip_info *chip,
 
 	chip->config1 = config1;
 
-	return ret;
+	return 0;
 }
 
 static ssize_t adt7316_store_enabled(struct device *dev,
-- 
2.53.0


             reply	other threads:[~2026-11-04  4:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-04  4:10 Maria Sheikh [this message]
2026-11-04  7:47 ` Dan Carpenter
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=20261104041237.7978-1-mariasheikh812@gmail.com \
    --to=mariasheikh812@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=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®