mirror of
https://github.com/torvalds/linux.git
synced 2026-05-26 08:02:27 +02:00
iio: light: gp2ap020a00f: Replace custom implementation of min()
Replace custom implementation of min() to save a few lines of code. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Ethan Tidmore <ethantidmore06@gmail.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
parent
550f5c0104
commit
7b9e5e5139
|
|
@ -38,6 +38,7 @@
|
|||
#include <linux/interrupt.h>
|
||||
#include <linux/irq.h>
|
||||
#include <linux/irq_work.h>
|
||||
#include <linux/minmax.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/mod_devicetable.h>
|
||||
#include <linux/mutex.h>
|
||||
|
|
@ -45,6 +46,7 @@
|
|||
#include <linux/regulator/consumer.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/unaligned.h>
|
||||
|
||||
#include <linux/iio/buffer.h>
|
||||
#include <linux/iio/events.h>
|
||||
#include <linux/iio/iio.h>
|
||||
|
|
@ -454,9 +456,7 @@ static int gp2ap020a00f_write_event_threshold(struct gp2ap020a00f_data *data,
|
|||
*/
|
||||
thresh_reg_val = data->thresh_val[th_val_id] / 16;
|
||||
else
|
||||
thresh_reg_val = data->thresh_val[th_val_id] > 16000 ?
|
||||
16000 :
|
||||
data->thresh_val[th_val_id];
|
||||
thresh_reg_val = min(data->thresh_val[th_val_id], 16000U);
|
||||
|
||||
thresh_buf = cpu_to_le16(thresh_reg_val);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user