random: do not include <asm/archrandom.h> from random.h
Subsystems (5)
Jason A. Donenfeld
maintainerPATCH v2 1/1 random: do not include <asm/archrandom.h> from random.h
The <asm/archrandom.h> header is a random.c private detail, not something to be called by other code. As such, don't make it automatically available by way of random.h.
--- arch/powerpc/kernel/setup-common.c | 1 + arch/s390/kernel/setup.c | 1 + drivers/char/random.c | 1 + include/linux/random.h | 2 -- 4 files changed, 3 insertions(+), 2 deletions(-)
arch/powerpc/kernel/setup-common.c +1 -0
@@ -59,6 +59,7 @@#include <asm/xmon.h> #include <asm/cputhreads.h> #include <mm/mmu_decl.h> +#include <asm/archrandom.h> #include <asm/fadump.h> #include <asm/udbg.h> #include <asm/hugetlb.h>
arch/s390/kernel/setup.c +1 -0
@@ -52,6 +52,7 @@#include <linux/hugetlb.h> #include <linux/kmemleak.h> +#include <asm/archrandom.h> #include <asm/boot_data.h> #include <asm/ipl.h> #include <asm/facility.h>
drivers/char/random.c +1 -0
@@ -55,6 +55,7 @@#include <linux/siphash.h> #include <crypto/chacha.h> #include <crypto/blake2s.h> +#include <asm/archrandom.h> #include <asm/processor.h> #include <asm/irq.h> #include <asm/irq_regs.h>
include/linux/random.h +0 -2
@@ -151,8 +151,6 @@ declare_get_random_var_wait(long, unsigned long)*/ #include <linux/prandom.h> -#include <asm/archrandom.h> -#ifdef CONFIG_SMP int random_prepare_cpu (unsigned int cpu);int random_online_cpu (unsigned int cpu);
Signature · 1 line
2.38.1
Le 29/10/2022 à 03:08, Jason A. Donenfeld a écrit :
Quoted 9 lines
The <
asm/archrandom.h> header is arandom.cprivate detail, not something to be called by other code. As such, don't make it automatically available by way ofrandom.h.Cc Michael Ellerman <[email protected]>Cc Heiko Carstens <[email protected]>Signed-off-by Jason A. Donenfeld <[email protected]>
For powerpc,
Quoted 56 lines
--- arch/powerpc/kernel/setup-common.c | 1 + arch/s390/kernel/setup.c | 1 + drivers/char/random.c | 1 + include/linux/random.h | 2 -- 4 files changed, 3 insertions(+), 2 deletions(-)arch/powerpc/kernel/setup-common.c +1
-0@@ -59,6 +59,7 @@#include <asm/xmon.h> #include <asm/cputhreads.h> #include <mm/mmu_decl.h> +#include <asm/archrandom.h> #include <asm/fadump.h> #include <asm/udbg.h> #include <asm/hugetlb.h> arch/s390/kernel/setup.c +1
-0@@ -52,6 +52,7 @@#include <linux/hugetlb.h> #include <linux/kmemleak.h> +#include <asm/archrandom.h> #include <asm/boot_data.h> #include <asm/ipl.h> #include <asm/facility.h> drivers/char/random.c +1
-0@@ -55,6 +55,7 @@#include <linux/siphash.h> #include <crypto/chacha.h> #include <crypto/blake2s.h> +#include <asm/archrandom.h> #include <asm/processor.h> #include <asm/irq.h> #include <asm/irq_regs.h> include/linux/random.h +0
-2@@ -151,8 +151,6 @@ declare_get_random_var_wait(long, unsigned long)*/ #include <linux/prandom.h> -#include <asm/archrandom.h> -#ifdef CONFIG_SMP int random_prepare_cpu (unsigned int cpu);int random_online_cpu (unsigned int cpu);
Jason A. Donenfeld
maintainerPATCH v3 1/1 random: do not include <asm/archrandom.h> from random.h
In reply to Jason A. DonenfeldThe <asm/archrandom.h> header is a random.c private detail, not something to be called by other code. As such, don't make it automatically available by way of random.h.
--- arch/powerpc/kernel/setup-common.c | 1 + arch/s390/kernel/setup.c | 1 + drivers/char/hw_random/s390-trng.c | 1 + drivers/char/random.c | 1 + include/linux/random.h | 2 -- 5 files changed, 4 insertions(+), 2 deletions(-)
arch/powerpc/kernel/setup-common.c +1 -0
@@ -59,6 +59,7 @@#include <asm/xmon.h> #include <asm/cputhreads.h> #include <mm/mmu_decl.h> +#include <asm/archrandom.h> #include <asm/fadump.h> #include <asm/udbg.h> #include <asm/hugetlb.h>
arch/s390/kernel/setup.c +1 -0
@@ -52,6 +52,7 @@#include <linux/hugetlb.h> #include <linux/kmemleak.h> +#include <asm/archrandom.h> #include <asm/boot_data.h> #include <asm/ipl.h> #include <asm/facility.h>
drivers/char/hw_random/s390-trng.c +1 -0
@@ -23,6 +23,7 @@#include <linux/sched/signal.h> #include <asm/debug.h> #include <asm/cpacf.h> +#include <asm/archrandom.h> MODULE_LICENSE ("GPL v2" );MODULE_AUTHOR ("IBM Corporation" );
drivers/char/random.c +1 -0
@@ -55,6 +55,7 @@#include <linux/siphash.h> #include <crypto/chacha.h> #include <crypto/blake2s.h> +#include <asm/archrandom.h> #include <asm/processor.h> #include <asm/irq.h> #include <asm/irq_regs.h>
include/linux/random.h +0 -2
@@ -151,8 +151,6 @@ declare_get_random_var_wait(long, unsigned long)*/ #include <linux/prandom.h> -#include <asm/archrandom.h> -#ifdef CONFIG_SMP int random_prepare_cpu (unsigned int cpu);int random_online_cpu (unsigned int cpu);
Signature · 1 line
2.38.1
Quoted 8 lines · Jason A. Donenfeld
The <
asm/archrandom.h> header is arandom.cprivate detail, not something to be called by other code. As such, don't make it automatically available by way ofrandom.h.Cc Michael Ellerman <[email protected]>Cc Heiko Carstens <[email protected]>Reviewed-by Christophe Leroy <[email protected]>Signed-off-by Jason A. Donenfeld <[email protected]>
Quoted 7 lines
--- arch/powerpc/kernel/setup-common.c | 1 + arch/s390/kernel/setup.c | 1 + drivers/char/hw_random/s390-trng.c | 1 + drivers/char/random.c | 1 + include/linux/random.h | 2 -- 5 files changed, 4 insertions(+), 2 deletions(-)