mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
ktime: Cleanup ktime_set() usage
ktime_set(S,N) was required for the timespec storage type and is still useful for situations where a Seconds and Nanoseconds part of a time value needs to be converted. For anything where the Seconds argument is 0, this is pointless and can be replaced with a simple assignment. Signed-off-by: Thomas Gleixner <[email protected]> Cc: Peter Zijlstra <[email protected]>
This commit is contained in:
parent
2456e85535
commit
8b0e195314
56 changed files with 84 additions and 95 deletions
|
|
@ -63,7 +63,7 @@ ssize_t iio_hrtimer_store_sampling_frequency(struct device *dev,
|
|||
return -EINVAL;
|
||||
|
||||
info->sampling_frequency = val;
|
||||
info->period = ktime_set(0, NSEC_PER_SEC / val);
|
||||
info->period = NSEC_PER_SEC / val;
|
||||
|
||||
return len;
|
||||
}
|
||||
|
|
@ -141,8 +141,7 @@ static struct iio_sw_trigger *iio_trig_hrtimer_probe(const char *name)
|
|||
trig_info->timer.function = iio_hrtimer_trig_handler;
|
||||
|
||||
trig_info->sampling_frequency = HRTIMER_DEFAULT_SAMPLING_FREQUENCY;
|
||||
trig_info->period = ktime_set(0, NSEC_PER_SEC /
|
||||
trig_info->sampling_frequency);
|
||||
trig_info->period = NSEC_PER_SEC / trig_info->sampling_frequency;
|
||||
|
||||
ret = iio_trigger_register(trig_info->swt.trigger);
|
||||
if (ret)
|
||||
|
|
|
|||
Loading…
Reference in a new issue