From: Chandra Mohan Sundar Date: Sat, 16 Aug 2025 13:37:55 +0000 (+0530) Subject: iio: adc: ad7768-1: Remove logically dead code X-Git-Tag: v6.18-rc1~74^2~7^2~106 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=26d48cc203e1c4d79b0bb6c7e2cdcaea5f548971;p=thirdparty%2Fkernel%2Fstable.git iio: adc: ad7768-1: Remove logically dead code The clamp macro returns a value within the specified range. In ad7768_set_freq(), the value returned from clamp() is checked against zero, which is not possible since the value would always be between 50 and 1024000. Removed the 'if' check. This issue was reported by static coverity analyser as logically dead code. Signed-off-by: Chandra Mohan Sundar Link: https://patch.msgid.link/20250816133757.98624-1-chandramohan.explore@gmail.com Signed-off-by: Jonathan Cameron --- diff --git a/drivers/iio/adc/ad7768-1.c b/drivers/iio/adc/ad7768-1.c index ca8fa91796ca4..a27591bbf7df0 100644 --- a/drivers/iio/adc/ad7768-1.c +++ b/drivers/iio/adc/ad7768-1.c @@ -687,8 +687,6 @@ static int ad7768_set_freq(struct ad7768_state *st, int ret; freq = clamp(freq, 50, 1024000); - if (freq == 0) - return -EINVAL; mclk_div = DIV_ROUND_CLOSEST(st->mclk_freq, freq * st->oversampling_ratio); /* Find the closest match for the desired sampling frequency */