Skip to content

Commit 69dcfc6

Browse files
committed
iio: adc: ad4630: Drop lower bound calibscale value check
The calibration scale value is stored in an unsigned variable so it's value can never be a negative number. Thus, drop the lower bound check for the calibration scale values as that is not needed. This fixes a 'comparison of unsigned expression in '< 0' is always false' build warn. Signed-off-by: Marcelo Schmitt <[email protected]>
1 parent 4781720 commit 69dcfc6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/iio/adc/ad4630.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ static int ad4630_set_chan_gain(struct iio_dev *indio_dev, int ch,
606606

607607
gain = gain_int * MICRO + gain_frac;
608608

609-
if (gain < 0 || gain > AD4630_GAIN_MAX)
609+
if (gain > AD4630_GAIN_MAX)
610610
return -EINVAL;
611611

612612
gain = DIV_ROUND_CLOSEST_ULL(gain * 0x8000, 1000000);

0 commit comments

Comments
 (0)