Skip to content

Commit afe4a43

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 2a88e7d commit afe4a43

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
@@ -608,7 +608,7 @@ static int ad4630_set_chan_gain(struct iio_dev *indio_dev, int ch,
608608

609609
gain = gain_int * MICRO + gain_frac;
610610

611-
if (gain < 0 || gain > AD4630_GAIN_MAX)
611+
if (gain > AD4630_GAIN_MAX)
612612
return -EINVAL;
613613

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

0 commit comments

Comments
 (0)