Skip to contentSkip to conversation

powerpc: Add cputime_to_nsecs()

PATCH Applied Anton Blanchard 2 participants 2 messages Jul 13, 2020 – Jul 16, 2020 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc: Add cputime_to_nsecs()

Generic code has a wrapper to implement cputime_to_nsecs() on top of cputime_to_usecs() but we can easily return the full nanosecond resolution directly.

---
 arch/powerpc/include/asm/cputime.h | 2 ++
 1 file changed, 2 insertions(+)
arch/powerpc/include/asm/cputime.h +2 -0
index 0fccd5ea1e9a..9335b93924b4 100644
@@ -36,6 +36,8 @@ static inline unsigned long cputime_to_usecs(const cputime_t ct)
 	return mulhdu((__force u64) ct, __cputime_usec_factor);
 }
 
+#define cputime_to_nsecs(cputime) tb_to_ns((__force u64)cputime)
+
 /*
  * PPC64 uses PACA which is task independent for storing accounting data while
  * PPC32 uses struct thread_info, therefore at task switch the accounting data
Signature · 1 line
2.26.2