iio: admv1013: replace redundant ternary operator with just len
PATCH 1/1 iio: admv1013: replace redundant ternary operator with just len
The variable ret is being assigned a return value and non-zero error return paths are taken at all stages. At the end of the function ret is always zero, so the ternary operator checking for zero ret is redundant and can be replaced with just len instead.
--- drivers/iio/frequency/admv1013.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/frequency/admv1013.c +1 -1
@@ -319,7 +319,7 @@ static ssize_t admv1013_write(struct iio_dev *indio_dev,return -EINVAL ; } -return ret ? ret : len; +return len; }static int admv1013_update_quad_filters (struct admv1013_state *st)
Signature · 1 line
2.49.0
Quoted 7 lines · Colin Ian King
The variable ret is being assigned a return value and non-zero error return paths are taken at all stages. At the end of the function ret is always zero, so the ternary operator checking for zero ret is redundant and can be replaced with just len instead.
Signed-off-by Colin Ian King <[email protected]>---
Quoted 11 lines · On Wed, 7 May 2025 08:49:46 -0500 David Lechner <[email protected]> wrote:
Quoted 7 lines · Colin Ian King
The variable ret is being assigned a return value and non-zero error return paths are taken at all stages. At the end of the function ret is always zero, so the ternary operator checking for zero ret is redundant and can be replaced with just len instead.
Signed-off-by Colin Ian King <[email protected]>---
Reviewed-by David Lechner <[email protected]>
Applied.