[patch 33/38] powerpc: Select ARCH_HAS_RANDOM_ENTROPY
Thomas Gleixner <[email protected]> Fri, 10 Apr 2026 14:21:09 +0200
| Newsgroups | org.kernel.vger.linux-hams,dev.linux.lists.iommu,dev.linux.lists.loongarch,org.infradead.lists.linux-arm-kernel,org.infradead.lists.linux-riscv,org.kernel.vger.linux-alpha,org.kernel.vger.linux-crypto,org.kernel.vger.linux-ext4,org.kernel.vger.linux-fbdev,org.kernel.vger.linux-kernel,org.kernel.vger.linux-m68k,org.kernel.vger.linux-openrisc,org.kernel.vger.linux-parisc,org.kernel.vger.linux-s390,org.kernel.vger.linux-wireless,org.kernel.vger.netdev,org.kernel.vger.sparclinux,org.kvack.linux-mm,org.ozlabs.lists.linuxppc-dev |
|---|---|
| Message-ID | <[email protected]> |
The only remaining usage of get_cycles() is to provide random_get_entropy(). Switch powerpc over to the new scheme of selecting ARCH_HAS_RANDOM_ENTROPY and providing random_get_entropy() in asm/random.h. Remove asm/timex.h as it has no functionality anymore. Signed-off-by: Thomas Gleixner <[email protected]> Cc: Michael Ellerman <[email protected]> Cc: [email protected] --- arch/powerpc/Kconfig | 1 + arch/powerpc/include/asm/random.h | 13 +++++++++++++ arch/powerpc/include/asm/timex.h | 21 --------------------- 3 files changed, 14 insertions(+), 21 deletions(-) --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -150,6 +150,7 @@ config PPC select ARCH_HAS_PREEMPT_LAZY select ARCH_HAS_PTDUMP select ARCH_HAS_PTE_SPECIAL + select ARCH_HAS_RANDOM_ENTROPY select ARCH_HAS_SCALED_CPUTIME if VIRT_CPU_ACCOUNTING_NATIVE && PPC_BOOK3S_64 select ARCH_HAS_SET_MEMORY select ARCH_HAS_STRICT_KERNEL_RWX if (PPC_BOOK3S || PPC_8xx) && !HIBERNATION --- /dev/null +++ b/arch/powerpc/include/asm/random.h @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _ASM_POWERPC_RANDOM_H +#define _ASM_POWERPC_RANDOM_H + +#include <asm/cputable.h> +#include <asm/vdso/timebase.h> + +static inline unsigned long random_get_entropy(void) +{ + return mftb(); +} + +#endif /* _ASM_POWERPC_RANDOM_H */ --- a/arch/powerpc/include/asm/timex.h +++ b/arch/powerpc/include/asm/timex.h @@ -1,21 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _ASM_POWERPC_TIMEX_H -#define _ASM_POWERPC_TIMEX_H - -#ifdef __KERNEL__ - -/* - * PowerPC architecture timex specifications - */ - -#include <asm/cputable.h> -#include <asm/vdso/timebase.h> - -ostatic inline cycles_t get_cycles(void) -{ - return mftb(); -} -#define get_cycles get_cycles - -#endif /* __KERNEL__ */ -#endif /* _ASM_POWERPC_TIMEX_H */