svn commit: r324393 - in head/sys: dev/random sys
Conrad Meyer
cem at FreeBSD.org
Sat Oct 7 18:59:31 UTC 2017
Author: cem
Date: Sat Oct 7 18:59:29 2017
New Revision: 324393
URL: https://svnweb.freebsd.org/changeset/base/324393
Log:
random(4): Add missing source descriptions
Add source descriptions missed in r260847, r303035.
While here, convert the array to C99 initializers.
Reviewed by: delphij
Approved by: secteam (delphij)
Sponsored by: Dell EMC Isilon
Differential Revision: https://reviews.freebsd.org/D12618
Modified:
head/sys/dev/random/random_harvestq.c
head/sys/sys/random.h
Modified: head/sys/dev/random/random_harvestq.c
==============================================================================
--- head/sys/dev/random/random_harvestq.c Sat Oct 7 18:49:39 2017 (r324392)
+++ head/sys/dev/random/random_harvestq.c Sat Oct 7 18:59:29 2017 (r324393)
@@ -260,26 +260,28 @@ random_print_harvestmask(SYSCTL_HANDLER_ARGS)
return (error);
}
-static const char *(random_source_descr[]) = {
- "CACHED",
- "ATTACH",
- "KEYBOARD",
- "MOUSE",
- "NET_TUN",
- "NET_ETHER",
- "NET_NG",
- "INTERRUPT",
- "SWI",
- "FS_ATIME",
- "UMA", /* ENVIRONMENTAL_END */
- "PURE_OCTEON",
- "PURE_SAFE",
- "PURE_GLXSB",
- "PURE_UBSEC",
- "PURE_HIFN",
- "PURE_RDRAND",
- "PURE_NEHEMIAH",
- "PURE_RNDTEST",
+static const char *random_source_descr[ENTROPYSOURCE] = {
+ [RANDOM_CACHED] = "CACHED",
+ [RANDOM_ATTACH] = "ATTACH",
+ [RANDOM_KEYBOARD] = "KEYBOARD",
+ [RANDOM_MOUSE] = "MOUSE",
+ [RANDOM_NET_TUN] = "NET_TUN",
+ [RANDOM_NET_ETHER] = "NET_ETHER",
+ [RANDOM_NET_NG] = "NET_NG",
+ [RANDOM_INTERRUPT] = "INTERRUPT",
+ [RANDOM_SWI] = "SWI",
+ [RANDOM_FS_ATIME] = "FS_ATIME",
+ [RANDOM_UMA] = "UMA", /* ENVIRONMENTAL_END */
+ [RANDOM_PURE_OCTEON] = "PURE_OCTEON",
+ [RANDOM_PURE_SAFE] = "PURE_SAFE",
+ [RANDOM_PURE_GLXSB] = "PURE_GLXSB",
+ [RANDOM_PURE_UBSEC] = "PURE_UBSEC",
+ [RANDOM_PURE_HIFN] = "PURE_HIFN",
+ [RANDOM_PURE_RDRAND] = "PURE_RDRAND",
+ [RANDOM_PURE_NEHEMIAH] = "PURE_NEHEMIAH",
+ [RANDOM_PURE_RNDTEST] = "PURE_RNDTEST",
+ [RANDOM_PURE_VIRTIO] = "PURE_VIRTIO",
+ [RANDOM_PURE_BROADCOM] = "PURE_BROADCOM",
/* "ENTROPYSOURCE" */
};
Modified: head/sys/sys/random.h
==============================================================================
--- head/sys/sys/random.h Sat Oct 7 18:49:39 2017 (r324392)
+++ head/sys/sys/random.h Sat Oct 7 18:59:29 2017 (r324393)
@@ -58,9 +58,9 @@ read_random(void *a __unused, u_int b __unused)
#endif
/*
- * Note: if you add or remove members of random_entropy_source, remember to also update the
- * KASSERT regarding what valid members are in random_harvest_internal(), and remember the
- * strings in the static array random_source_descr[] in random_harvestq.c.
+ * Note: if you add or remove members of random_entropy_source, remember to
+ * also update the strings in the static array random_source_descr[] in
+ * random_harvestq.c.
*
* NOTE: complain loudly to markm@ or on the lists if this enum gets more than 32
* distinct values (0-31)! ENTROPYSOURCE may be == 32, but not > 32.
More information about the svn-src-all
mailing list