Module Name: src
Committed By: kamil
Date: Fri Jun 5 21:48:04 UTC 2020
Modified Files:
src/sys/arch/x86/x86: cpu_rng.c
Log Message:
Change const unsigned to preprocessor define
Fixes GCC -O0 build with the stack protector.
To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/x86/x86/cpu_rng.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/x86/x86/cpu_rng.c
diff -u src/sys/arch/x86/x86/cpu_rng.c:1.14 src/sys/arch/x86/x86/cpu_rng.c:1.15
--- src/sys/arch/x86/x86/cpu_rng.c:1.14 Sun May 10 06:30:57 2020
+++ src/sys/arch/x86/x86/cpu_rng.c Fri Jun 5 21:48:03 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu_rng.c,v 1.14 2020/05/10 06:30:57 maxv Exp $ */
+/* $NetBSD: cpu_rng.c,v 1.15 2020/06/05 21:48:03 kamil Exp $ */
/*-
* Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -249,7 +249,7 @@ cpu_rng(enum cpu_rng_mode mode, uint64_t
static void
cpu_rng_get(size_t nbytes, void *cookie)
{
- const unsigned N = howmany(256, 64);
+#define N howmany(256, 64)
uint64_t buf[2*N];
unsigned i, nbits = 0;
@@ -269,6 +269,7 @@ cpu_rng_get(size_t nbytes, void *cookie)
}
rnd_add_data_sync(&cpu_rng_source, buf, sizeof buf, nbits);
}
+#undef N
}
void