linux-next: manual merge of the bitmap tree with the random tree

From: Stephen Rothwell
Date: Tue Jul 26 2022 - 04:57:04 EST


Hi all,

Today's linux-next merge of the bitmap tree got a conflict in:

arch/powerpc/include/asm/archrandom.h

between commits:

9592eef7c16e ("random: remove CONFIG_ARCH_RANDOM")
d349ab99eec7 ("random: handle archrandom with multiple longs")

from the random tree and commit:

2f9905799751 ("powerpc: drop dependency on <asm/machdep.h> in archrandom.h")

from the bitmap tree.

I fixed it up (see bottom and also applied the following merge fix patch)
and can carry the fix as necessary. This is now fixed as far as linux-next
is concerned, but any non trivial conflicts should be mentioned to your
upstream maintainer when your tree is submitted for merging. You may
also want to consider cooperating with the maintainer of the conflicting
tree to minimise any particularly complex conflicts.

From: Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx>
Date: Tue, 26 Jul 2022 18:47:56 +1000
Subject: [PATCH] fix up for "powerpc: drop dependency on <asm/machdep.h> in archrandom.h"

interacting with "random: handle archrandom with multiple longs" and
"random: remove CONFIG_ARCH_RANDOM"

Signed-off-by: Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx>
---
arch/powerpc/kernel/setup-common.c | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
index 194d09461767..409a0a763fe4 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -171,16 +171,13 @@ EXPORT_SYMBOL_GPL(machine_power_off);
void (*pm_power_off)(void);
EXPORT_SYMBOL_GPL(pm_power_off);

-#ifdef CONFIG_ARCH_RANDOM
-bool __must_check arch_get_random_seed_long(unsigned long *v)
+size_t arch_get_random_seed_longs(unsigned long *v, size_t max_longs)
{
- if (ppc_md.get_random_seed)
- return ppc_md.get_random_seed(v);
-
- return false;
+ if (max_longs && ppc_md.get_random_seed && ppc_md.get_random_seed(v))
+ return 1;
+ return 0;
}
-EXPORT_SYMBOL(arch_get_random_seed_long);
-#endif
+EXPORT_SYMBOL(arch_get_random_seed_longs);

void machine_halt(void)
{
--
2.35.1

--
Cheers,
Stephen Rothwell

diff --cc arch/powerpc/include/asm/archrandom.h
index 0e365c5b2396,21def59ef1a6..c94c9d782533
--- a/arch/powerpc/include/asm/archrandom.h
+++ b/arch/powerpc/include/asm/archrandom.h
@@@ -2,19 -2,33 +2,12 @@@
#ifndef _ASM_POWERPC_ARCHRANDOM_H
#define _ASM_POWERPC_ARCHRANDOM_H

- #include <asm/machdep.h>
-#ifdef CONFIG_ARCH_RANDOM
-
-bool __must_check arch_get_random_seed_long(unsigned long *v);
-
-static inline bool __must_check arch_get_random_long(unsigned long *v)
-{
- return false;
-}
--
-static inline bool __must_check arch_get_random_int(unsigned int *v)
+static inline size_t __must_check arch_get_random_longs(unsigned long *v, size_t max_longs)
{
- return false;
+ return 0;
}

- static inline size_t __must_check arch_get_random_seed_longs(unsigned long *v, size_t max_longs)
-
-static inline bool __must_check arch_get_random_seed_int(unsigned int *v)
--{
- if (max_longs && ppc_md.get_random_seed && ppc_md.get_random_seed(v))
- return 1;
- return 0;
- unsigned long val;
- bool rc;
-
- rc = arch_get_random_seed_long(&val);
- if (rc)
- *v = val;
-
- return rc;
--}
-#endif /* CONFIG_ARCH_RANDOM */
++size_t __must_check arch_get_random_seed_longs(unsigned long *v, size_t max_longs);

#ifdef CONFIG_PPC_POWERNV
int powernv_hwrng_present(void);

Attachment: pgpH2D_GsuB5m.pgp
Description: OpenPGP digital signature