From: Colin Ian King Date: Wed, 7 May 2025 13:45:02 +0000 (+0100) Subject: iio: admv1013: replace redundant ternary operator with just len X-Git-Url: http://git.monstr.eu/?a=commitdiff_plain;h=6cdb4009c20186cc3aed7b09187d1cd366960d78;p=linux-2.6-microblaze.git 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. Signed-off-by: Colin Ian King Reviewed-by: David Lechner Link: https://patch.msgid.link/20250507134502.254736-1-colin.i.king@gmail.com Signed-off-by: Jonathan Cameron --- diff --git a/drivers/iio/frequency/admv1013.c b/drivers/iio/frequency/admv1013.c index 6f50884d7130..d8e8d541990f 100644 --- a/drivers/iio/frequency/admv1013.c +++ b/drivers/iio/frequency/admv1013.c @@ -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)