Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <chandramohan.explore@gmail.com>
Link: https://patch.msgid.link/20250816133757.98624-1-chandramohan.explore@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Chandra Mohan Sundar and committed by
Jonathan Cameron
26d48cc2 35e3d0cd

-2
-2
drivers/iio/adc/ad7768-1.c
··· 687 687 int ret; 688 688 689 689 freq = clamp(freq, 50, 1024000); 690 - if (freq == 0) 691 - return -EINVAL; 692 690 693 691 mclk_div = DIV_ROUND_CLOSEST(st->mclk_freq, freq * st->oversampling_ratio); 694 692 /* Find the closest match for the desired sampling frequency */