Commit 6c249591 authored by Cristian Sicilia's avatar Cristian Sicilia Committed by Jonathan Cameron

staging: iio: adc: ad7280a: Adding temp var to improve readability

Creating a temporary variable to improve readability
Signed-off-by: default avatarCristian Sicilia <sicilia.cristian@gmail.com>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent d04411c2
...@@ -784,43 +784,38 @@ static irqreturn_t ad7280_event_handler(int irq, void *private) ...@@ -784,43 +784,38 @@ static irqreturn_t ad7280_event_handler(int irq, void *private)
for (i = 0; i < st->scan_cnt; i++) { for (i = 0; i < st->scan_cnt; i++) {
if (((channels[i] >> 23) & 0xF) <= AD7280A_CELL_VOLTAGE_6) { if (((channels[i] >> 23) & 0xF) <= AD7280A_CELL_VOLTAGE_6) {
if (((channels[i] >> 11) & 0xFFF) >= if (((channels[i] >> 11) & 0xFFF) >=
st->cell_threshhigh) st->cell_threshhigh) {
iio_push_event(indio_dev, u64 tmp = IIO_EVENT_CODE(IIO_VOLTAGE, 1, 0,
IIO_EVENT_CODE(IIO_VOLTAGE, IIO_EV_DIR_RISING,
1, IIO_EV_TYPE_THRESH,
0, 0, 0, 0);
IIO_EV_DIR_RISING, iio_push_event(indio_dev, tmp,
IIO_EV_TYPE_THRESH,
0, 0, 0),
iio_get_time_ns(indio_dev)); iio_get_time_ns(indio_dev));
else if (((channels[i] >> 11) & 0xFFF) <= } else if (((channels[i] >> 11) & 0xFFF) <=
st->cell_threshlow) st->cell_threshlow) {
iio_push_event(indio_dev, u64 tmp = IIO_EVENT_CODE(IIO_VOLTAGE, 1, 0,
IIO_EVENT_CODE(IIO_VOLTAGE, IIO_EV_DIR_FALLING,
1, IIO_EV_TYPE_THRESH,
0, 0, 0, 0);
IIO_EV_DIR_FALLING, iio_push_event(indio_dev, tmp,
IIO_EV_TYPE_THRESH,
0, 0, 0),
iio_get_time_ns(indio_dev)); iio_get_time_ns(indio_dev));
}
} else { } else {
if (((channels[i] >> 11) & 0xFFF) >= st->aux_threshhigh) if (((channels[i] >> 11) & 0xFFF) >=
iio_push_event(indio_dev, st->aux_threshhigh) {
IIO_UNMOD_EVENT_CODE( u64 tmp = IIO_UNMOD_EVENT_CODE(IIO_TEMP, 0,
IIO_TEMP,
0,
IIO_EV_TYPE_THRESH, IIO_EV_TYPE_THRESH,
IIO_EV_DIR_RISING), IIO_EV_DIR_RISING);
iio_push_event(indio_dev, tmp,
iio_get_time_ns(indio_dev)); iio_get_time_ns(indio_dev));
else if (((channels[i] >> 11) & 0xFFF) <= } else if (((channels[i] >> 11) & 0xFFF) <=
st->aux_threshlow) st->aux_threshlow) {
iio_push_event(indio_dev, u64 tmp = IIO_UNMOD_EVENT_CODE(IIO_TEMP, 0,
IIO_UNMOD_EVENT_CODE(
IIO_TEMP,
0,
IIO_EV_TYPE_THRESH, IIO_EV_TYPE_THRESH,
IIO_EV_DIR_FALLING), IIO_EV_DIR_FALLING);
iio_push_event(indio_dev, tmp,
iio_get_time_ns(indio_dev)); iio_get_time_ns(indio_dev));
}
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment