Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/i2c whitelist -> permitlist
details: https://anonhg.NetBSD.org/src/rev/1347f641c037
branches: trunk
changeset: 1011726:1347f641c037
user: thorpej <thorpej%NetBSD.org@localhost>
date: Tue Jul 07 16:14:23 2020 +0000
description:
whitelist -> permitlist
diffstat:
sys/arch/x86/x86/x86_autoconf.c | 18 +++++++++---------
sys/dev/i2c/i2c.c | 27 ++++++++++++++-------------
sys/dev/i2c/i2cvar.h | 6 +++---
3 files changed, 26 insertions(+), 25 deletions(-)
diffs (140 lines):
diff -r 2a949bcdae81 -r 1347f641c037 sys/arch/x86/x86/x86_autoconf.c
--- a/sys/arch/x86/x86/x86_autoconf.c Tue Jul 07 14:29:06 2020 +0000
+++ b/sys/arch/x86/x86/x86_autoconf.c Tue Jul 07 16:14:23 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: x86_autoconf.c,v 1.82 2020/05/02 16:44:36 bouyer Exp $ */
+/* $NetBSD: x86_autoconf.c,v 1.83 2020/07/07 16:14:23 thorpej Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: x86_autoconf.c,v 1.82 2020/05/02 16:44:36 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: x86_autoconf.c,v 1.83 2020/07/07 16:14:23 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -569,24 +569,24 @@
*/
if (device_is_a(dev, "iic") &&
device_is_a(dev->dv_parent, "imcsmb")) {
- static const char *imcsmb_device_whitelist[] = {
+ static const char *imcsmb_device_permitlist[] = {
"spdmem",
"sdtemp",
NULL,
};
- prop_array_t whitelist = prop_array_create();
+ prop_array_t permitlist = prop_array_create();
prop_dictionary_t props = device_properties(dev);
int i;
- for (i = 0; imcsmb_device_whitelist[i] != NULL; i++) {
+ for (i = 0; imcsmb_device_permitlist[i] != NULL; i++) {
prop_string_t pstr = prop_string_create_cstring_nocopy(
- imcsmb_device_whitelist[i]);
- (void) prop_array_add(whitelist, pstr);
+ imcsmb_device_permitlist[i]);
+ (void) prop_array_add(permitlist, pstr);
prop_object_release(pstr);
}
(void) prop_dictionary_set(props,
- I2C_PROP_INDIRECT_DEVICE_WHITELIST,
- whitelist);
+ I2C_PROP_INDIRECT_DEVICE_PERMITLIST,
+ permitlist);
(void) prop_dictionary_set_cstring_nocopy(props,
I2C_PROP_INDIRECT_PROBE_STRATEGY,
I2C_PROBE_STRATEGY_NONE);
diff -r 2a949bcdae81 -r 1347f641c037 sys/dev/i2c/i2c.c
--- a/sys/dev/i2c/i2c.c Tue Jul 07 14:29:06 2020 +0000
+++ b/sys/dev/i2c/i2c.c Tue Jul 07 16:14:23 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: i2c.c,v 1.74 2020/06/12 03:32:30 thorpej Exp $ */
+/* $NetBSD: i2c.c,v 1.75 2020/07/07 16:14:23 thorpej Exp $ */
/*
* Copyright (c) 2003 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
#endif
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i2c.c,v 1.74 2020/06/12 03:32:30 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i2c.c,v 1.75 2020/07/07 16:14:23 thorpej Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -207,29 +207,30 @@
}
static bool
-iic_indirect_driver_is_whitelisted(struct iic_softc *sc, cfdata_t cf)
+iic_indirect_driver_is_permitted(struct iic_softc *sc, cfdata_t cf)
{
prop_object_iterator_t iter;
- prop_array_t whitelist;
+ prop_array_t permitlist;
prop_string_t pstr;
prop_type_t ptype;
bool rv = false;
- whitelist = prop_dictionary_get(device_properties(sc->sc_dev),
- I2C_PROP_INDIRECT_DEVICE_WHITELIST);
- if (whitelist == NULL) {
- /* No whitelist -> everything allowed */
+ permitlist = prop_dictionary_get(device_properties(sc->sc_dev),
+ I2C_PROP_INDIRECT_DEVICE_PERMITLIST);
+ if (permitlist == NULL) {
+ /* No permitlist -> everything allowed */
return (true);
}
- if ((ptype = prop_object_type(whitelist)) != PROP_TYPE_ARRAY) {
+ if ((ptype = prop_object_type(permitlist)) != PROP_TYPE_ARRAY) {
aprint_error_dev(sc->sc_dev,
"invalid property type (%d) for '%s'; must be array (%d)\n",
- ptype, I2C_PROP_INDIRECT_DEVICE_WHITELIST, PROP_TYPE_ARRAY);
+ ptype, I2C_PROP_INDIRECT_DEVICE_PERMITLIST,
+ PROP_TYPE_ARRAY);
return (false);
}
- iter = prop_array_iterator(whitelist);
+ iter = prop_array_iterator(permitlist);
while ((pstr = prop_object_iterator_next(iter)) != NULL) {
if (prop_string_equals_string(pstr, cf->cf_name)) {
rv = true;
@@ -253,9 +254,9 @@
/*
* Before we do any more work, consult the allowed-driver
- * white-list for this bus (if any).
+ * permit-list for this bus (if any).
*/
- if (iic_indirect_driver_is_whitelisted(sc, cf) == false)
+ if (iic_indirect_driver_is_permitted(sc, cf) == false)
return (0);
/* default to "quick write". */
diff -r 2a949bcdae81 -r 1347f641c037 sys/dev/i2c/i2cvar.h
--- a/sys/dev/i2c/i2cvar.h Tue Jul 07 14:29:06 2020 +0000
+++ b/sys/dev/i2c/i2cvar.h Tue Jul 07 16:14:23 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: i2cvar.h,v 1.19 2019/12/22 23:23:32 thorpej Exp $ */
+/* $NetBSD: i2cvar.h,v 1.20 2020/07/07 16:14:23 thorpej Exp $ */
/*
* Copyright (c) 2003 Wasabi Systems, Inc.
@@ -61,8 +61,8 @@
#define I2C_PROBE_STRATEGY_NONE \
"none"
-#define I2C_PROP_INDIRECT_DEVICE_WHITELIST \
- "i2c-indirect-device-whitelist"
+#define I2C_PROP_INDIRECT_DEVICE_PERMITLIST \
+ "i2c-indirect-device-permitlist"
/* value is a prop_array of prop_strings */
struct ic_intr_list {
Home |
Main Index |
Thread Index |
Old Index