treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / arch / s390 / include / asm / cputime.h
blobcb729d111e206065b06ed56c855841c2fd2febe9
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3 * Copyright IBM Corp. 2004
5 * Author: Martin Schwidefsky <schwidefsky@de.ibm.com>
6 */
8 #ifndef _S390_CPUTIME_H
9 #define _S390_CPUTIME_H
11 #include <linux/types.h>
12 #include <asm/timex.h>
14 #define CPUTIME_PER_USEC 4096ULL
15 #define CPUTIME_PER_SEC (CPUTIME_PER_USEC * USEC_PER_SEC)
17 /* We want to use full resolution of the CPU timer: 2**-12 micro-seconds. */
19 #define cmpxchg_cputime(ptr, old, new) cmpxchg64(ptr, old, new)
22 * Convert cputime to microseconds.
24 static inline u64 cputime_to_usecs(const u64 cputime)
26 return cputime >> 12;
30 * Convert cputime to nanoseconds.
32 #define cputime_to_nsecs(cputime) tod_to_ns(cputime)
34 u64 arch_cpu_idle_time(int cpu);
36 #define arch_idle_time(cpu) arch_cpu_idle_time(cpu)
38 #endif /* _S390_CPUTIME_H */