2
0
mirror of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-09-04 20:19:47 +08:00

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 <colin.i.king@gmail.com>
Reviewed-by: David Lechner <dlechner@baylibre.com>
Link: https://patch.msgid.link/20250507134502.254736-1-colin.i.king@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
Colin Ian King 2025-05-07 14:45:02 +01:00 committed by Jonathan Cameron
parent 805bbd3ac9
commit 6cdb4009c2

View File

@ -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)