Skip to content

Commit b1ec080

Browse files
agnersjic23
authored andcommitted
iio: adc: max9611: explicitly cast gain_selectors
After finding a reasonable gain, the function converts the configured gain to a gain configuration option selector enum max9611_csa_gain. Make the conversion clearly visible by using an explicit cast. This also avoids a warning seen with clang: drivers/iio/adc/max9611.c:292:16: warning: implicit conversion from enumeration type 'enum max9611_conf_ids' to different enumeration type 'enum max9611_csa_gain' [-Wenum-conversion] *csa_gain = gain_selectors[i]; ~ ^~~~~~~~~~~~~~~~~ Signed-off-by: Stefan Agner <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
1 parent 1a5bc41 commit b1ec080

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/iio/adc/max9611.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ static int max9611_read_csa_voltage(struct max9611_dev *max9611,
289289
return ret;
290290

291291
if (*adc_raw > 0) {
292-
*csa_gain = gain_selectors[i];
292+
*csa_gain = (enum max9611_csa_gain)gain_selectors[i];
293293
return 0;
294294
}
295295
}

0 commit comments

Comments
 (0)