Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/x86/x86 Change const unsigned to preprocessor define



details:   https://anonhg.NetBSD.org/src/rev/ecc002f1a73b
branches:  trunk
changeset: 934060:ecc002f1a73b
user:      kamil <kamil%NetBSD.org@localhost>
date:      Fri Jun 05 21:48:03 2020 +0000

description:
Change const unsigned to preprocessor define

Fixes GCC -O0 build with the stack protector.

diffstat:

 sys/arch/x86/x86/cpu_rng.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (26 lines):

diff -r 0e36b7117785 -r ecc002f1a73b sys/arch/x86/x86/cpu_rng.c
--- a/sys/arch/x86/x86/cpu_rng.c        Fri Jun 05 19:45:51 2020 +0000
+++ b/sys/arch/x86/x86/cpu_rng.c        Fri Jun 05 21:48:03 2020 +0000
@@ -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 @@
 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 @@
                }
                rnd_add_data_sync(&cpu_rng_source, buf, sizeof buf, nbits);
        }
+#undef N
 }
 
 void



Home | Main Index | Thread Index | Old Index