linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] random: do not include <asm/archrandom.h> from random.h
@ 2022-10-29  1:08 Jason A. Donenfeld
  2022-11-03  8:23 ` Christophe Leroy
  2022-11-03 12:17 ` [PATCH v3] " Jason A. Donenfeld
  0 siblings, 2 replies; 4+ messages in thread
From: Jason A. Donenfeld @ 2022-10-29  1:08 UTC (permalink / raw)
  To: linux-kernel
  Cc: Jason A. Donenfeld, Michael Ellerman, Heiko Carstens,
	linuxppc-dev, linux-s390

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.

Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: linuxppc-dev@lists.ozlabs.org
Cc: linux-s390@vger.kernel.org
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
---
 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(-)

diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
index 6d041993a45d..9b10e57040c6 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -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>
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
index ab19ddb09d65..b53a45735a5d 100644
--- a/arch/s390/kernel/setup.c
+++ b/arch/s390/kernel/setup.c
@@ -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>
diff --git a/drivers/char/random.c b/drivers/char/random.c
index e3cf4f51ed58..a7afd17db075 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -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>
diff --git a/include/linux/random.h b/include/linux/random.h
index 2bdd3add3400..47e7cf126e8f 100644
--- a/include/linux/random.h
+++ b/include/linux/random.h
@@ -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);
-- 
2.38.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] random: do not include <asm/archrandom.h> from random.h
  2022-10-29  1:08 [PATCH v2] random: do not include <asm/archrandom.h> from random.h Jason A. Donenfeld
@ 2022-11-03  8:23 ` Christophe Leroy
  2022-11-03 12:17 ` [PATCH v3] " Jason A. Donenfeld
  1 sibling, 0 replies; 4+ messages in thread
From: Christophe Leroy @ 2022-11-03  8:23 UTC (permalink / raw)
  To: Jason A. Donenfeld, linux-kernel; +Cc: linuxppc-dev, Heiko Carstens, linux-s390



Le 29/10/2022 à 03:08, Jason A. Donenfeld a écrit :
> 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.
> 
> Cc: Michael Ellerman <mpe@ellerman.id.au>
> Cc: Heiko Carstens <hca@linux.ibm.com>
> Cc: linuxppc-dev@lists.ozlabs.org
> Cc: linux-s390@vger.kernel.org
> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>

For powerpc,

Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>

> ---
>   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(-)
> 
> diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
> index 6d041993a45d..9b10e57040c6 100644
> --- a/arch/powerpc/kernel/setup-common.c
> +++ b/arch/powerpc/kernel/setup-common.c
> @@ -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>
> diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
> index ab19ddb09d65..b53a45735a5d 100644
> --- a/arch/s390/kernel/setup.c
> +++ b/arch/s390/kernel/setup.c
> @@ -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>
> diff --git a/drivers/char/random.c b/drivers/char/random.c
> index e3cf4f51ed58..a7afd17db075 100644
> --- a/drivers/char/random.c
> +++ b/drivers/char/random.c
> @@ -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>
> diff --git a/include/linux/random.h b/include/linux/random.h
> index 2bdd3add3400..47e7cf126e8f 100644
> --- a/include/linux/random.h
> +++ b/include/linux/random.h
> @@ -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);

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v3] random: do not include <asm/archrandom.h> from random.h
  2022-10-29  1:08 [PATCH v2] random: do not include <asm/archrandom.h> from random.h Jason A. Donenfeld
  2022-11-03  8:23 ` Christophe Leroy
@ 2022-11-03 12:17 ` Jason A. Donenfeld
  2022-11-04 14:34   ` Heiko Carstens
  1 sibling, 1 reply; 4+ messages in thread
From: Jason A. Donenfeld @ 2022-11-03 12:17 UTC (permalink / raw)
  To: Heiko Carstens, linux-s390, linux-kernel; +Cc: Jason A. Donenfeld

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.

Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Heiko Carstens <hca@linux.ibm.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
---
 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(-)

diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
index 6d041993a45d..9b10e57040c6 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -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>
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
index ab19ddb09d65..b53a45735a5d 100644
--- a/arch/s390/kernel/setup.c
+++ b/arch/s390/kernel/setup.c
@@ -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>
diff --git a/drivers/char/hw_random/s390-trng.c b/drivers/char/hw_random/s390-trng.c
index 795853dfc46b..3a388e1c3631 100644
--- a/drivers/char/hw_random/s390-trng.c
+++ b/drivers/char/hw_random/s390-trng.c
@@ -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");
diff --git a/drivers/char/random.c b/drivers/char/random.c
index bf6144c1de7d..b696f5dd3241 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -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>
diff --git a/include/linux/random.h b/include/linux/random.h
index 2bdd3add3400..47e7cf126e8f 100644
--- a/include/linux/random.h
+++ b/include/linux/random.h
@@ -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);
-- 
2.38.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v3] random: do not include <asm/archrandom.h> from random.h
  2022-11-03 12:17 ` [PATCH v3] " Jason A. Donenfeld
@ 2022-11-04 14:34   ` Heiko Carstens
  0 siblings, 0 replies; 4+ messages in thread
From: Heiko Carstens @ 2022-11-04 14:34 UTC (permalink / raw)
  To: Jason A. Donenfeld; +Cc: linux-s390, linux-kernel

On Thu, Nov 03, 2022 at 01:17:40PM +0100, Jason A. Donenfeld wrote:
> 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.
> 
> Cc: Michael Ellerman <mpe@ellerman.id.au>
> Cc: Heiko Carstens <hca@linux.ibm.com>
> Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
> ---
>  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(-)

Acked-by: Heiko Carstens <hca@linux.ibm.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-11-04 14:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-29  1:08 [PATCH v2] random: do not include <asm/archrandom.h> from random.h Jason A. Donenfeld
2022-11-03  8:23 ` Christophe Leroy
2022-11-03 12:17 ` [PATCH v3] " Jason A. Donenfeld
2022-11-04 14:34   ` Heiko Carstens

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).