Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

misc: ioc4: Use ktime_get_ns()

Replace the ever recurring:
ts = ktime_get_ts();
ns = timespec_to_ns(&ts);
with
ns = ktime_get_ns();

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: John Stultz <john.stultz@linaro.org>

authored by

Thomas Gleixner and committed by
John Stultz
6d9b757c 154adc14

+2 -5
+2 -5
drivers/misc/ioc4.c
··· 145 145 union ioc4_int_out int_out; 146 146 union ioc4_gpcr gpcr; 147 147 unsigned int state, last_state = 1; 148 - struct timespec start_ts, end_ts; 149 148 uint64_t start, end, period; 150 149 unsigned int count = 0; 151 150 ··· 173 174 if (!last_state && state) { 174 175 count++; 175 176 if (count == IOC4_CALIBRATE_END) { 176 - ktime_get_ts(&end_ts); 177 + end = ktime_get_ns(); 177 178 break; 178 179 } else if (count == IOC4_CALIBRATE_DISCARD) 179 - ktime_get_ts(&start_ts); 180 + start = ktime_get_ns(); 180 181 } 181 182 last_state = state; 182 183 } while (1); ··· 191 192 * by which the IOC4 generates the square wave, to get the 192 193 * period of an IOC4 INT_OUT count. 193 194 */ 194 - end = end_ts.tv_sec * NSEC_PER_SEC + end_ts.tv_nsec; 195 - start = start_ts.tv_sec * NSEC_PER_SEC + start_ts.tv_nsec; 196 195 period = (end - start) / 197 196 (IOC4_CALIBRATE_CYCLES * 2 * (IOC4_CALIBRATE_COUNT + 1)); 198 197