[RFC PATCH powerpc] Fix compiling error in powernv/rng.c

Li Zhong zhong at linux.vnet.ibm.com
Fri Nov 15 18:36:04 EST 2013


This is seen when CONFIG_SMP is not enabled:

arch/powerpc/platforms/powernv/rng.c: In function 'rng_init_per_cpu':
arch/powerpc/platforms/powernv/rng.c:74: error: implicit declaration of function 'cpu_to_chip_id'

Signed-off-by: Li Zhong <zhong at linux.vnet.ibm.com>
---
 arch/powerpc/platforms/powernv/rng.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/platforms/powernv/rng.c b/arch/powerpc/platforms/powernv/rng.c
index 8844628..04430a7 100644
--- a/arch/powerpc/platforms/powernv/rng.c
+++ b/arch/powerpc/platforms/powernv/rng.c
@@ -59,6 +59,7 @@ int powernv_get_random_long(unsigned long *v)
 }
 EXPORT_SYMBOL_GPL(powernv_get_random_long);
 
+#ifdef CONFIG_SMP
 static __init void rng_init_per_cpu(struct powernv_rng *rng,
 				    struct device_node *dn)
 {
@@ -75,6 +76,13 @@ static __init void rng_init_per_cpu(struct powernv_rng *rng,
 		}
 	}
 }
+#else
+static __init void rng_init_per_cpu(struct powernv_rng *rng,
+				    struct device_node *dn)
+{
+	per_cpu(powernv_rng, 0) = rng;
+}
+#endif
 
 static __init int rng_create(struct device_node *dn)
 {




More information about the Linuxppc-dev mailing list