[PATCH] staging: iio: addac: adt7316: return 0 in _adt7316_store_enabled
From: Maria Sheikh
Date: Tue Nov 03 2026 - 23:13:02 EST
_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@xxxxxxxxx>
---
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