mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 22:21:40 +00:00
iio/imu: inv_icm42600: Use max() helper macros
Use the standard max() helper macros instead of direct variable comparison using if/else blocks or ternary operator. Change identified using minmax.cocci Coccinelle semantic patch. Signed-off-by: Bragatheswaran Manickavel <bragathemanick0908@gmail.com> Acked-by: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com> Link: https://lore.kernel.org/r/20231027094410.3706-1-bragathemanick0908@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
parent
3f6b9598b6
commit
c788b9e56a
@ -137,10 +137,7 @@ static int inv_icm42600_accel_update_scan_mode(struct iio_dev *indio_dev,
|
|||||||
out_unlock:
|
out_unlock:
|
||||||
mutex_unlock(&st->lock);
|
mutex_unlock(&st->lock);
|
||||||
/* sleep maximum required time */
|
/* sleep maximum required time */
|
||||||
if (sleep_accel > sleep_temp)
|
sleep = max(sleep_accel, sleep_temp);
|
||||||
sleep = sleep_accel;
|
|
||||||
else
|
|
||||||
sleep = sleep_temp;
|
|
||||||
if (sleep)
|
if (sleep)
|
||||||
msleep(sleep);
|
msleep(sleep);
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -424,10 +424,7 @@ out_unlock:
|
|||||||
mutex_unlock(&st->lock);
|
mutex_unlock(&st->lock);
|
||||||
|
|
||||||
/* sleep maximum required time */
|
/* sleep maximum required time */
|
||||||
if (sleep_sensor > sleep_temp)
|
sleep = max(sleep_sensor, sleep_temp);
|
||||||
sleep = sleep_sensor;
|
|
||||||
else
|
|
||||||
sleep = sleep_temp;
|
|
||||||
if (sleep)
|
if (sleep)
|
||||||
msleep(sleep);
|
msleep(sleep);
|
||||||
|
|
||||||
|
@ -137,10 +137,7 @@ static int inv_icm42600_gyro_update_scan_mode(struct iio_dev *indio_dev,
|
|||||||
out_unlock:
|
out_unlock:
|
||||||
mutex_unlock(&st->lock);
|
mutex_unlock(&st->lock);
|
||||||
/* sleep maximum required time */
|
/* sleep maximum required time */
|
||||||
if (sleep_gyro > sleep_temp)
|
sleep = max(sleep_gyro, sleep_temp);
|
||||||
sleep = sleep_gyro;
|
|
||||||
else
|
|
||||||
sleep = sleep_temp;
|
|
||||||
if (sleep)
|
if (sleep)
|
||||||
msleep(sleep);
|
msleep(sleep);
|
||||||
return ret;
|
return ret;
|
||||||
|
Loading…
Reference in New Issue
Block a user