lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20200304020715.2352-1-yuehaibing@huawei.com>
Date:   Wed, 4 Mar 2020 10:07:15 +0800
From:   YueHaibing <yuehaibing@...wei.com>
To:     <tytso@....edu>, <arnd@...db.de>, <gregkh@...uxfoundation.org>,
        <mark.rutland@....com>
CC:     <linux-kernel@...r.kernel.org>, yuehaibing <yuehaibing@...wei.com>
Subject: [PATCH -next] random: Fix unused function warning

From: yuehaibing <yuehaibing@...wei.com>

drivers/char/random.c:820:13: warning:
 crng_initialize_secondary defined but not used [-Wunused-function]

crng_initialize_secondary now only used in do_numa_crng_init,
which wrapped by CONFIG_NUMA, so move it to fix the warning.

Reported-by: Hulk Robot <hulkci@...wei.com>
Signed-off-by: yuehaibing <yuehaibing@...wei.com>
---
 drivers/char/random.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/char/random.c b/drivers/char/random.c
index f43f65c..3646ad7 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -817,14 +817,6 @@ static bool __init crng_init_try_arch_early(struct crng_state *crng)
 	return arch_init;
 }
 
-static void crng_initialize_secondary(struct crng_state *crng)
-{
-	memcpy(&crng->state[0], "expand 32-byte k", 16);
-	_get_random_bytes(&crng->state[4], sizeof(__u32) * 12);
-	crng_init_try_arch(crng);
-	crng->init_time = jiffies - CRNG_RESEED_INTERVAL - 1;
-}
-
 static void __init crng_initialize_primary(struct crng_state *crng)
 {
 	memcpy(&crng->state[0], "expand 32-byte k", 16);
@@ -839,6 +831,14 @@ static void __init crng_initialize_primary(struct crng_state *crng)
 }
 
 #ifdef CONFIG_NUMA
+static void crng_initialize_secondary(struct crng_state *crng)
+{
+	memcpy(&crng->state[0], "expand 32-byte k", 16);
+	_get_random_bytes(&crng->state[4], sizeof(__u32) * 12);
+	crng_init_try_arch(crng);
+	crng->init_time = jiffies - CRNG_RESEED_INTERVAL - 1;
+}
+
 static void do_numa_crng_init(struct work_struct *work)
 {
 	int i;
-- 
2.7.4


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ