diff options
| author | riastradh <riastradh@NetBSD.org> | 2021-12-31 11:05:41 +0000 |
|---|---|---|
| committer | riastradh <riastradh@NetBSD.org> | 2021-12-31 11:05:41 +0000 |
| commit | 02b0acbc16114e3582c53e5a58a29a6ad8dba7cf (patch) | |
| tree | 02e6cc9fe5f85b3abec14afef6639097dad02351 /sys/dev/sysmon | |
| parent | 8355308efd2d5ca039f853554c5478164938f3c1 (diff) | |
sysmon: Delete trailing whitespace. No functional change intended.
Diffstat (limited to 'sys/dev/sysmon')
| -rw-r--r-- | sys/dev/sysmon/swsensor.c | 14 | ||||
| -rw-r--r-- | sys/dev/sysmon/swwdog.c | 20 | ||||
| -rw-r--r-- | sys/dev/sysmon/sysmon.c | 23 | ||||
| -rw-r--r-- | sys/dev/sysmon/sysmon_envsys.c | 105 | ||||
| -rw-r--r-- | sys/dev/sysmon/sysmon_envsys_events.c | 26 | ||||
| -rw-r--r-- | sys/dev/sysmon/sysmon_envsysvar.h | 16 | ||||
| -rw-r--r-- | sys/dev/sysmon/sysmon_power.c | 28 | ||||
| -rw-r--r-- | sys/dev/sysmon/sysmon_taskq.c | 19 | ||||
| -rw-r--r-- | sys/dev/sysmon/sysmon_wdog.c | 20 | ||||
| -rw-r--r-- | sys/dev/sysmon/sysmonvar.h | 8 |
10 files changed, 129 insertions, 150 deletions
diff --git a/sys/dev/sysmon/swsensor.c b/sys/dev/sysmon/swsensor.c index 2d18f685571..37ad81914f4 100644 --- a/sys/dev/sysmon/swsensor.c +++ b/sys/dev/sysmon/swsensor.c @@ -1,4 +1,4 @@ -/* $NetBSD: swsensor.c,v 1.18 2020/06/11 02:39:31 thorpej Exp $ */ +/* $NetBSD: swsensor.c,v 1.19 2021/12/31 11:05:41 riastradh Exp $ */ /* * Copyright (c) 2008 The NetBSD Foundation, Inc. * All rights reserved. @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: swsensor.c,v 1.18 2020/06/11 02:39:31 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: swsensor.c,v 1.19 2021/12/31 11:05:41 riastradh Exp $"); #include <sys/param.h> #include <sys/kernel.h> @@ -139,18 +139,18 @@ swsensor_refresh(struct sysmon_envsys *sme, envsys_data_t *edata) * Sensor get/set limit routines */ -static void +static void swsensor_get_limits(struct sysmon_envsys *sme, envsys_data_t *edata, - sysmon_envsys_lim_t *limits, uint32_t *props) + sysmon_envsys_lim_t *limits, uint32_t *props) { *props = PROP_CRITMIN | PROP_DRIVER_LIMITS; limits->sel_critmin = sw_sensor_limit; } -static void +static void swsensor_set_limits(struct sysmon_envsys *sme, envsys_data_t *edata, - sysmon_envsys_lim_t *limits, uint32_t *props) + sysmon_envsys_lim_t *limits, uint32_t *props) { if (limits == NULL) { @@ -250,7 +250,7 @@ swsensor_init(void *arg) /* Sensor limit behavior * 0 - simple sensor, no hw limits * 1 - simple sensor, hw provides initial limit - * 2 - complex sensor, hw provides settable + * 2 - complex sensor, hw provides settable * limits and does its own limit checking */ if (strcmp(key, "mode") == 0) { diff --git a/sys/dev/sysmon/swwdog.c b/sys/dev/sysmon/swwdog.c index 33b55a921cb..74801c6f242 100644 --- a/sys/dev/sysmon/swwdog.c +++ b/sys/dev/sysmon/swwdog.c @@ -1,4 +1,4 @@ -/* $NetBSD: swwdog.c,v 1.22 2020/03/16 21:20:09 pgoyette Exp $ */ +/* $NetBSD: swwdog.c,v 1.23 2021/12/31 11:05:41 riastradh Exp $ */ /* * Copyright (c) 2004, 2005 Steven M. Bellovin @@ -33,7 +33,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: swwdog.c,v 1.22 2020/03/16 21:20:09 pgoyette Exp $"); +__KERNEL_RCSID(0, "$NetBSD: swwdog.c,v 1.23 2021/12/31 11:05:41 riastradh Exp $"); /* * @@ -286,8 +286,7 @@ SYSCTL_SETUP(swwdog_sysctl_setup, "swwdog sysctl") * Module management */ -static -int +static int swwdog_init(void *arg) { /* @@ -314,8 +313,7 @@ swwdog_init(void *arg) return error; } -static -int +static int swwdog_fini(void *arg) { int error; @@ -337,26 +335,22 @@ swwdog_fini(void *arg) return error; } -static -int +static int swwdog_modcmd(modcmd_t cmd, void *arg) { int ret; - + switch (cmd) { case MODULE_CMD_INIT: ret = swwdog_init(arg); break; - case MODULE_CMD_FINI: ret = swwdog_fini(arg); break; - case MODULE_CMD_STAT: default: ret = ENOTTY; } - + return ret; } - diff --git a/sys/dev/sysmon/sysmon.c b/sys/dev/sysmon/sysmon.c index a96abd025e5..46aedaad733 100644 --- a/sys/dev/sysmon/sysmon.c +++ b/sys/dev/sysmon/sysmon.c @@ -1,4 +1,4 @@ -/* $NetBSD: sysmon.c,v 1.30 2019/08/26 10:05:34 nakayama Exp $ */ +/* $NetBSD: sysmon.c,v 1.31 2021/12/31 11:05:41 riastradh Exp $ */ /*- * Copyright (c) 2000 Zembu Labs, Inc. @@ -39,7 +39,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: sysmon.c,v 1.30 2019/08/26 10:05:34 nakayama Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sysmon.c,v 1.31 2021/12/31 11:05:41 riastradh Exp $"); #include <sys/param.h> #include <sys/conf.h> @@ -78,7 +78,7 @@ const struct cdevsw sysmon_cdevsw = { .d_flag = D_OTHER | D_MPSAFE }; -static int sysmon_modcmd(modcmd_t, void *); +static int sysmon_modcmd(modcmd_t, void *); static int sm_init_once(void); /* @@ -364,25 +364,22 @@ sysmon_fini(void) return error; } -static -int +static int sysmon_modcmd(modcmd_t cmd, void *arg) { int ret; - - switch (cmd) { + + switch (cmd) { case MODULE_CMD_INIT: ret = sysmon_init(); break; - - case MODULE_CMD_FINI: - ret = sysmon_fini(); + case MODULE_CMD_FINI: + ret = sysmon_fini(); break; - case MODULE_CMD_STAT: - default: + default: ret = ENOTTY; } - + return ret; } diff --git a/sys/dev/sysmon/sysmon_envsys.c b/sys/dev/sysmon/sysmon_envsys.c index c2b61bb6a5f..04cd95b929a 100644 --- a/sys/dev/sysmon/sysmon_envsys.c +++ b/sys/dev/sysmon/sysmon_envsys.c @@ -1,4 +1,4 @@ -/* $NetBSD: sysmon_envsys.c,v 1.148 2021/09/07 13:24:46 andvar Exp $ */ +/* $NetBSD: sysmon_envsys.c,v 1.149 2021/12/31 11:05:41 riastradh Exp $ */ /*- * Copyright (c) 2007, 2008 Juan Romero Pardines. @@ -64,7 +64,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: sysmon_envsys.c,v 1.148 2021/09/07 13:24:46 andvar Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sysmon_envsys.c,v 1.149 2021/12/31 11:05:41 riastradh Exp $"); #include <sys/param.h> #include <sys/types.h> @@ -105,7 +105,7 @@ static uint32_t sme_get_max_value(struct sysmon_envsys *, MODULE(MODULE_CLASS_DRIVER, sysmon_envsys, "sysmon,sysmon_taskq,sysmon_power"); -static struct sysmon_opvec sysmon_envsys_opvec = { +static struct sysmon_opvec sysmon_envsys_opvec = { sysmonopen_envsys, sysmonclose_envsys, sysmonioctl_envsys, NULL, NULL, NULL }; @@ -203,7 +203,7 @@ sysmonioctl_envsys(dev_t dev, u_long cmd, void *data, int flag, struct lwp *l) /* * Update dictionaries on all sysmon envsys devices * registered. - */ + */ mutex_enter(&sme_global_mtx); LIST_FOREACH(sme, &sysmon_envsys_list, sme_list) { sysmon_envsys_acquire(sme, false); @@ -266,7 +266,7 @@ sysmonioctl_envsys(dev_t dev, u_long cmd, void *data, int flag, struct lwp *l) prop_object_release(udict); return EINVAL; } - + devname = prop_dictionary_keysym_value(obj); DPRINTF(("%s: processing the '%s' array requests\n", __func__, devname)); @@ -309,7 +309,7 @@ sysmonioctl_envsys(dev_t dev, u_long cmd, void *data, int flag, struct lwp *l) * process the list of sensors and properties. */ while ((obj2 = prop_object_iterator_next(iter2))) { - /* + /* * do the real work now. */ error = sme_userset_dictionary(sme, @@ -407,7 +407,7 @@ sysmonioctl_envsys(dev_t dev, u_long cmd, void *data, int flag, struct lwp *l) mutex_exit(&sme->sme_mtx); } - /* + /* * copy required values to the old interface. */ tred->sensor = edata->sensor; @@ -516,7 +516,7 @@ sysmonioctl_envsys(dev_t dev, u_long cmd, void *data, int flag, struct lwp *l) /* * sysmon_envsys_create: - * + * * + Allocates a new sysmon_envsys object and initializes the * stuff for sensors and events. */ @@ -574,7 +574,7 @@ sysmon_envsys_sensor_attach(struct sysmon_envsys *sme, envsys_data_t *edata) KASSERT(sme != NULL || edata != NULL); - /* + /* * Find the correct units for this sensor. */ sdt_units = sme_find_table_entry(SME_DESC_UNITS, edata->units); @@ -731,7 +731,7 @@ sysmon_envsys_register(struct sysmon_envsys *sme) return ENOTSUP; } - /* + /* * Initialize the singly linked list for driver events. */ SLIST_INIT(&sme_evdrv_list); @@ -763,7 +763,7 @@ sysmon_envsys_register(struct sysmon_envsys *sme) } } - /* + /* * If the array does not contain any object (sensor), there's * no need to attach the driver. */ @@ -1111,7 +1111,7 @@ sysmon_envsys_release(struct sysmon_envsys *sme, bool locked) /* * sme_initial_refresh: - * + * * + Do an initial refresh of the sensors in a device just after * interrupts are enabled in the autoconf(9) process. * @@ -1249,8 +1249,8 @@ sme_remove_userprops(void) * If there were any limit values removed, we * need to revert to initial limits. * - * First, tell the driver that we need it to - * restore any h/w limits which may have been + * First, tell the driver that we need it to + * restore any h/w limits which may have been * changed to stored, boot-time values. */ if (sme->sme_set_limits) { @@ -1342,7 +1342,7 @@ sme_remove_userprops(void) /* * sme_add_property_dictionary: - * + * * + Add global properties into a device. */ static int @@ -1458,7 +1458,7 @@ sme_add_sensor_dictionary(struct sysmon_envsys *sme, prop_array_t array, * <key>monitoring-supported</key> * <true/> * ... - * + * * always false on Battery {capacity,charge}, Drive and Indicator types. * They cannot be monitored. * @@ -1571,7 +1571,7 @@ sme_get_max_value(struct sysmon_envsys *sme, envsys_data_t *edata; uint32_t maxv, v; - /* + /* * Iterate over all sensors that match the predicate */ maxv = 0; @@ -1579,7 +1579,7 @@ sme_get_max_value(struct sysmon_envsys *sme, if (!(*predicate)(edata)) continue; - /* + /* * refresh sensor data */ mutex_enter(&sme->sme_mtx); @@ -1608,7 +1608,7 @@ sme_update_dictionary(struct sysmon_envsys *sme) prop_object_t array, dict, obj, obj2; int error = 0; - /* + /* * Retrieve the array of dictionaries in device. */ array = prop_dictionary_get(sme_propd, sme->sme_name); @@ -1638,7 +1638,7 @@ sme_update_dictionary(struct sysmon_envsys *sme) sme->sme_events_timeout)) return EINVAL; - /* + /* * - iterate over all sensors. * - fetch new data. * - check if data in dictionary is different than new data. @@ -1653,14 +1653,14 @@ sme_update_dictionary(struct sysmon_envsys *sme) * is going to be removed or added it will have to wait. */ TAILQ_FOREACH(edata, &sme->sme_sensors_list, sensors_head) { - /* + /* * refresh sensor data via sme_envsys_refresh_sensor */ mutex_enter(&sme->sme_mtx); sysmon_envsys_refresh_sensor(sme, edata); mutex_exit(&sme->sme_mtx); - /* + /* * retrieve sensor's dictionary. */ dict = prop_array_get(array, edata->sensor); @@ -1670,7 +1670,7 @@ sme_update_dictionary(struct sysmon_envsys *sme) return EINVAL; } - /* + /* * update sensor's state. */ error = sme_update_sensor_dictionary(dict, edata, true); @@ -1703,7 +1703,7 @@ sme_update_sensor_dictionary(prop_object_t dict, envsys_data_t *edata, if (error) return (-error); - /* + /* * update sensor's type. */ sdt = sme_find_table_entry(SME_DESC_UNITS, edata->units); @@ -1718,7 +1718,7 @@ sme_update_sensor_dictionary(prop_object_t dict, envsys_data_t *edata, return (-error); if (value_update) { - /* + /* * update sensor's current value. */ error = sme_sensor_upint32(dict, "cur-value", edata->value_cur); @@ -1734,7 +1734,7 @@ sme_update_sensor_dictionary(prop_object_t dict, envsys_data_t *edata, edata->units == ENVSYS_BATTERY_CHARGE) return error; - /* + /* * update sensor flags. */ if (edata->flags & ENVSYS_FPERCENT) { @@ -1761,7 +1761,7 @@ sme_update_sensor_dictionary(prop_object_t dict, envsys_data_t *edata, return error; } - /* + /* * update 'rpms' only for ENVSYS_SFANRPM sensors. */ if (edata->units == ENVSYS_SFANRPM) { @@ -1770,7 +1770,7 @@ sme_update_sensor_dictionary(prop_object_t dict, envsys_data_t *edata, return error; } - /* + /* * update 'rfact' only for ENVSYS_SVOLTS_[AD]C sensors. */ if (edata->units == ENVSYS_SVOLTS_AC || @@ -1781,7 +1781,7 @@ sme_update_sensor_dictionary(prop_object_t dict, envsys_data_t *edata, } } - /* + /* * update 'drive-state' only for ENVSYS_DRIVE sensors. */ if (edata->units == ENVSYS_DRIVE) { @@ -1794,7 +1794,7 @@ sme_update_sensor_dictionary(prop_object_t dict, envsys_data_t *edata, return error; } - /* + /* * update 'battery-capacity' only for ENVSYS_BATTERY_CAPACITY * sensors. */ @@ -1863,7 +1863,7 @@ sme_userset_dictionary(struct sysmon_envsys *sme, prop_dictionary_t udict, return error; } else if (!obj) { - /* + /* * Get sensor's index from userland dictionary. */ obj = prop_dictionary_get(udict, "index"); @@ -1889,7 +1889,7 @@ sme_userset_dictionary(struct sysmon_envsys *sme, prop_dictionary_t udict, dict = prop_array_get(array, edata->sensor); obj1 = prop_dictionary_get(dict, "index"); - /* + /* * is it our sensor? */ if (!prop_string_equals(obj1, obj)) @@ -1939,7 +1939,7 @@ sme_userset_dictionary(struct sysmon_envsys *sme, prop_dictionary_t udict, mutex_exit(&sme->sme_mtx); } - /* + /* * did the user want to change the rfact? */ obj2 = prop_dictionary_get(udict, "rfact"); @@ -1960,7 +1960,7 @@ sme_userset_dictionary(struct sysmon_envsys *sme, prop_dictionary_t udict, sdt = sme_find_table_entry(SME_DESC_UNITS, edata->units); - /* + /* * did the user want to set a critical capacity event? */ obj2 = prop_dictionary_get(udict, "critical-capacity"); @@ -1970,7 +1970,7 @@ sme_userset_dictionary(struct sysmon_envsys *sme, prop_dictionary_t udict, props |= PROP_BATTCAP; } - /* + /* * did the user want to set a warning capacity event? */ obj2 = prop_dictionary_get(udict, "warning-capacity"); @@ -1980,7 +1980,7 @@ sme_userset_dictionary(struct sysmon_envsys *sme, prop_dictionary_t udict, props |= PROP_BATTWARN; } - /* + /* * did the user want to set a high capacity event? */ obj2 = prop_dictionary_get(udict, "high-capacity"); @@ -1990,7 +1990,7 @@ sme_userset_dictionary(struct sysmon_envsys *sme, prop_dictionary_t udict, props |= PROP_BATTHIGH; } - /* + /* * did the user want to set a maximum capacity event? */ obj2 = prop_dictionary_get(udict, "maximum-capacity"); @@ -2000,7 +2000,7 @@ sme_userset_dictionary(struct sysmon_envsys *sme, prop_dictionary_t udict, props |= PROP_BATTMAX; } - /* + /* * did the user want to set a critical max event? */ obj2 = prop_dictionary_get(udict, "critical-max"); @@ -2010,7 +2010,7 @@ sme_userset_dictionary(struct sysmon_envsys *sme, prop_dictionary_t udict, props |= PROP_CRITMAX; } - /* + /* * did the user want to set a warning max event? */ obj2 = prop_dictionary_get(udict, "warning-max"); @@ -2020,7 +2020,7 @@ sme_userset_dictionary(struct sysmon_envsys *sme, prop_dictionary_t udict, props |= PROP_WARNMAX; } - /* + /* * did the user want to set a critical min event? */ obj2 = prop_dictionary_get(udict, "critical-min"); @@ -2030,7 +2030,7 @@ sme_userset_dictionary(struct sysmon_envsys *sme, prop_dictionary_t udict, props |= PROP_CRITMIN; } - /* + /* * did the user want to set a warning min event? */ obj2 = prop_dictionary_get(udict, "warning-min"); @@ -2053,7 +2053,7 @@ sme_userset_dictionary(struct sysmon_envsys *sme, prop_dictionary_t udict, sdt->crittype); if (error == EEXIST) error = 0; - if (error) + if (error) goto out; } @@ -2064,7 +2064,7 @@ sme_userset_dictionary(struct sysmon_envsys *sme, prop_dictionary_t udict, } out: - /* + /* * invalid target? return the error. */ if (!targetfound) @@ -2080,7 +2080,7 @@ out: * If the callback returns false, the remainder of the current * device's sensors are skipped. */ -void +void sysmon_envsys_foreach_sensor(sysmon_envsys_callback_t func, void *arg, bool refresh) { @@ -2122,25 +2122,22 @@ sysmon_envsys_refresh_sensor(struct sysmon_envsys *sme, envsys_data_t *edata) edata->value_prev = edata->value_cur; } -static -int +static int sysmon_envsys_modcmd(modcmd_t cmd, void *arg) { int ret; - - switch (cmd) { + + switch (cmd) { case MODULE_CMD_INIT: ret = sysmon_envsys_init(); break; - case MODULE_CMD_FINI: ret = sysmon_envsys_fini(); - break; - + break; case MODULE_CMD_STAT: default: ret = ENOTTY; } - - return ret; -} + + return ret; +} diff --git a/sys/dev/sysmon/sysmon_envsys_events.c b/sys/dev/sysmon/sysmon_envsys_events.c index d45be9ee6c6..1f1917ba633 100644 --- a/sys/dev/sysmon/sysmon_envsys_events.c +++ b/sys/dev/sysmon/sysmon_envsys_events.c @@ -1,4 +1,4 @@ -/* $NetBSD: sysmon_envsys_events.c,v 1.121 2017/09/11 06:02:09 pgoyette Exp $ */ +/* $NetBSD: sysmon_envsys_events.c,v 1.122 2021/12/31 11:05:41 riastradh Exp $ */ /*- * Copyright (c) 2007, 2008 Juan Romero Pardines. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: sysmon_envsys_events.c,v 1.121 2017/09/11 06:02:09 pgoyette Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sysmon_envsys_events.c,v 1.122 2021/12/31 11:05:41 riastradh Exp $"); #include <sys/param.h> #include <sys/types.h> @@ -165,7 +165,7 @@ sme_event_register(prop_dictionary_t sdict, envsys_data_t *edata, if ((props & PROP_VAL_LIMITS) && (edata->upropset & PROP_CAP_LIMITS)) props = 0; - /* + /* * check if the event is already on the list and return * EEXIST if value provided hasn't been changed. */ @@ -178,7 +178,7 @@ sme_event_register(prop_dictionary_t sdict, envsys_data_t *edata, continue; /* - * We found an existing event for this sensor. Make + * We found an existing event for this sensor. Make * sure it references the correct edata */ KASSERT(edata == osee->see_edata); @@ -247,7 +247,7 @@ sme_event_register(prop_dictionary_t sdict, envsys_data_t *edata, break; case PENVSYS_EVENT_STATE_CHANGED: if (edata->units == ENVSYS_BATTERY_CAPACITY) - see->see_evstate = + see->see_evstate = ENVSYS_BATTERY_CAPACITY_NORMAL; else if (edata->units == ENVSYS_DRIVE) see->see_evstate = ENVSYS_DRIVE_EMPTY; @@ -544,7 +544,7 @@ sme_event_drvadd(void *arg) } } - /* + /* * we are done, free memory now. */ kmem_free(sed_t, sizeof(*sed_t)); @@ -696,7 +696,7 @@ sme_update_limits(struct sysmon_envsys *sme, envsys_data_t *edata) DPRINTF(("%s: array device failed\n", __func__)); return EINVAL; } - + sdict = prop_array_get(array, edata->sensor); if (sdict == NULL) { return EINVAL; @@ -774,7 +774,7 @@ sme_events_worker(struct work *wk, void *arg) mutex_enter(&sme->sme_mtx); see->see_flags |= SEE_EVENT_WORKING; - /* + /* * sme_events_check marks the sensors to make us refresh them here. * sme_envsys_refresh_sensor will not call the driver if the driver * does its own setting of the sensor value. @@ -845,7 +845,7 @@ out: * no event type is specified, deliver all events for the sensor. */ void -sysmon_envsys_sensor_event(struct sysmon_envsys *sme, envsys_data_t *edata, +sysmon_envsys_sensor_event(struct sysmon_envsys *sme, envsys_data_t *edata, int ev_type) { sme_event_t *see; @@ -943,7 +943,7 @@ sme_deliver_event(sme_event_t *see) * send the event... */ case PENVSYS_EVENT_STATE_CHANGED: - /* + /* * the state has not been changed, just ignore the event. */ if (edata->value_cur == see->see_evvalue) @@ -973,7 +973,7 @@ sme_deliver_event(sme_event_t *see) if (sdt->type == -1) break; - /* + /* * copy current state description. */ (void)strlcpy(see->see_pes.pes_statedesc, sdt->desc, @@ -993,7 +993,7 @@ sme_deliver_event(sme_event_t *see) see->see_evvalue = edata->value_cur; - /* + /* * There's no need to continue if it's a drive sensor. */ if (edata->units == ENVSYS_DRIVE) @@ -1081,7 +1081,7 @@ sme_acadapter_check(void) if (!sensor) return false; - /* + /* * AC adapter found and not connected. */ return true; diff --git a/sys/dev/sysmon/sysmon_envsysvar.h b/sys/dev/sysmon/sysmon_envsysvar.h index 695b8c44460..9a7e9de20bc 100644 --- a/sys/dev/sysmon/sysmon_envsysvar.h +++ b/sys/dev/sysmon/sysmon_envsysvar.h @@ -1,4 +1,4 @@ -/* $NetBSD: sysmon_envsysvar.h,v 1.47 2014/11/23 10:00:20 ozaki-r Exp $ */ +/* $NetBSD: sysmon_envsysvar.h,v 1.48 2021/12/31 11:05:41 riastradh Exp $ */ /*- * Copyright (c) 2007, 2008 Juan Romero Pardines. @@ -69,7 +69,7 @@ enum sme_descr_type { */ #define SME_EVENTS_DEFTIMEOUT 30 -/* +/* * struct used by a sysmon envsys event. */ typedef struct sme_event { @@ -85,7 +85,7 @@ typedef struct sme_event { #define SEE_EVENT_WORKING 0x0001 /* This event is busy */ } sme_event_t; -/* +/* * struct by a sysmon envsys event set by a driver. */ typedef struct sme_event_drv { @@ -101,19 +101,19 @@ struct sme_descr_entry { const char *desc; }; -/* +/* * common stuff. */ extern kmutex_t sme_global_mtx; /* for the sme linked list and dict */ extern prop_dictionary_t sme_propd; /* the global sensor dictionary */ -/* +/* * linked list for the sysmon envsys devices. */ LIST_HEAD(sysmon_envsys_lh, sysmon_envsys); extern struct sysmon_envsys_lh sysmon_envsys_list; -/* +/* * functions to handle sysmon envsys devices. */ int sme_update_dictionary(struct sysmon_envsys *); @@ -125,7 +125,7 @@ struct sysmon_envsys *sysmon_envsys_find(const char *); void sysmon_envsys_acquire(struct sysmon_envsys *, bool); void sysmon_envsys_release(struct sysmon_envsys *, bool); -/* +/* * functions to handle sysmon envsys events. */ int sme_event_register(prop_dictionary_t, envsys_data_t *, @@ -144,7 +144,7 @@ void sme_deliver_event(sme_event_t *); int sme_update_limits(struct sysmon_envsys *, envsys_data_t *); void sme_schedule_callout(struct sysmon_envsys *); -/* +/* * common functions to create/update objects in a dictionary. */ int sme_sensor_upbool(prop_dictionary_t, const char *, bool); diff --git a/sys/dev/sysmon/sysmon_power.c b/sys/dev/sysmon/sysmon_power.c index 402f6a6c83e..a3652b1f6c5 100644 --- a/sys/dev/sysmon/sysmon_power.c +++ b/sys/dev/sysmon/sysmon_power.c @@ -1,4 +1,4 @@ -/* $NetBSD: sysmon_power.c,v 1.68 2021/09/26 16:24:21 thorpej Exp $ */ +/* $NetBSD: sysmon_power.c,v 1.69 2021/12/31 11:05:41 riastradh Exp $ */ /*- * Copyright (c) 2007 Juan Romero Pardines. @@ -69,7 +69,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: sysmon_power.c,v 1.68 2021/09/26 16:24:21 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sysmon_power.c,v 1.69 2021/12/31 11:05:41 riastradh Exp $"); #ifdef _KERNEL_OPT #include "opt_compat_netbsd.h" @@ -334,9 +334,9 @@ sysmon_power_daemon_task(struct power_event_dictionary *ped, memset(&pev, 0, sizeof(pev)); mutex_enter(&sysmon_power_event_queue_mtx); - + switch (event) { - /* + /* * Power switch events. */ case PSWITCH_EVENT_PRESSED: @@ -363,7 +363,7 @@ sysmon_power_daemon_task(struct power_event_dictionary *ped, break; } - /* + /* * ENVSYS events. */ case PENVSYS_EVENT_NORMAL: @@ -386,7 +386,7 @@ sysmon_power_daemon_task(struct power_event_dictionary *ped, error = sysmon_power_make_dictionary(ped->dict, penvsys, - event, + event, pev.pev_type); if (error) { mutex_exit(&sysmon_power_event_queue_mtx); @@ -1013,7 +1013,7 @@ sysmon_pswitch_event(struct sysmon_pswitch *smpsw, int event) prop_object_release(ped->dict); kmem_free(ped, sizeof(*ped)); } - + switch (smpsw->smpsw_type) { case PSWITCH_TYPE_POWER: if (event != PSWITCH_EVENT_PRESSED) { @@ -1112,26 +1112,22 @@ sysmon_pswitch_event(struct sysmon_pswitch *smpsw, int event) } } -static -int +static int sysmon_power_modcmd(modcmd_t cmd, void *arg) { int ret; - - switch (cmd) { + + switch (cmd) { case MODULE_CMD_INIT: ret = sysmon_power_init(); break; - - case MODULE_CMD_FINI: + case MODULE_CMD_FINI: ret = sysmon_power_fini(); break; - case MODULE_CMD_STAT: - default: + default: ret = ENOTTY; } return ret; } - diff --git a/sys/dev/sysmon/sysmon_taskq.c b/sys/dev/sysmon/sysmon_taskq.c index e027d009b92..81e878a8f4c 100644 --- a/sys/dev/sysmon/sysmon_taskq.c +++ b/sys/dev/sysmon/sysmon_taskq.c @@ -1,4 +1,4 @@ -/* $NetBSD: sysmon_taskq.c,v 1.20 2018/02/08 09:05:20 dholland Exp $ */ +/* $NetBSD: sysmon_taskq.c,v 1.21 2021/12/31 11:05:41 riastradh Exp $ */ /* * Copyright (c) 2001, 2003 Wasabi Systems, Inc. @@ -41,7 +41,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: sysmon_taskq.c,v 1.20 2018/02/08 09:05:20 dholland Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sysmon_taskq.c,v 1.21 2021/12/31 11:05:41 riastradh Exp $"); #include <sys/param.h> #include <sys/malloc.h> @@ -246,26 +246,23 @@ sysmon_task_queue_sched(u_int pri, void (*func)(void *), void *arg) return 0; } -static -int +static int sysmon_taskq_modcmd(modcmd_t cmd, void *arg) { int ret; - - switch (cmd) { + + switch (cmd) { case MODULE_CMD_INIT: sysmon_task_queue_init(); ret = 0; break; - - case MODULE_CMD_FINI: + case MODULE_CMD_FINI: ret = sysmon_task_queue_fini(); break; - case MODULE_CMD_STAT: - default: + default: ret = ENOTTY; } - + return ret; } diff --git a/sys/dev/sysmon/sysmon_wdog.c b/sys/dev/sysmon/sysmon_wdog.c index f8e1a6a037c..01cef32d7b8 100644 --- a/sys/dev/sysmon/sysmon_wdog.c +++ b/sys/dev/sysmon/sysmon_wdog.c @@ -1,4 +1,4 @@ -/* $NetBSD: sysmon_wdog.c,v 1.29 2015/12/14 01:08:47 pgoyette Exp $ */ +/* $NetBSD: sysmon_wdog.c,v 1.30 2021/12/31 11:05:41 riastradh Exp $ */ /*- * Copyright (c) 2000 Zembu Labs, Inc. @@ -41,7 +41,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: sysmon_wdog.c,v 1.29 2015/12/14 01:08:47 pgoyette Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sysmon_wdog.c,v 1.30 2021/12/31 11:05:41 riastradh Exp $"); #include <sys/param.h> #include <sys/conf.h> @@ -76,7 +76,7 @@ void sysmon_wdog_critpoll(void *); void sysmon_wdog_shutdown(void *); void sysmon_wdog_ref(struct sysmon_wdog *); -static struct sysmon_opvec sysmon_wdog_opvec = { +static struct sysmon_opvec sysmon_wdog_opvec = { sysmonopen_wdog, sysmonclose_wdog, sysmonioctl_wdog, NULL, NULL, NULL }; @@ -551,25 +551,23 @@ sysmon_wdog_shutdown(void *arg) smw->smw_name); } } -static -int + +static int sysmon_wdog_modcmd(modcmd_t cmd, void *arg) { int ret; - + switch (cmd) { case MODULE_CMD_INIT: ret = sysmon_wdog_init(); break; - case MODULE_CMD_FINI: ret = sysmon_wdog_fini(); - break; - + break; case MODULE_CMD_STAT: default: ret = ENOTTY; } - - return ret; + + return ret; } diff --git a/sys/dev/sysmon/sysmonvar.h b/sys/dev/sysmon/sysmonvar.h index e31901485a2..8a60b7fff8b 100644 --- a/sys/dev/sysmon/sysmonvar.h +++ b/sys/dev/sysmon/sysmonvar.h @@ -1,4 +1,4 @@ -/* $NetBSD: sysmonvar.h,v 1.50 2017/09/11 06:02:09 pgoyette Exp $ */ +/* $NetBSD: sysmonvar.h,v 1.51 2021/12/31 11:05:41 riastradh Exp $ */ /*- * Copyright (c) 2000 Zembu Labs, Inc. @@ -170,7 +170,7 @@ struct sysmon_envsys { void *sme_cookie; /* for ENVSYS back-end */ - /* + /* * Function callback to receive data from device. */ void (*sme_refresh)(struct sysmon_envsys *, envsys_data_t *); @@ -194,12 +194,12 @@ struct sysmon_envsys { uint64_t sme_events_timeout; /* the timeout used in the callout */ - /* + /* * linked list for the sysmon envsys devices. */ LIST_ENTRY(sysmon_envsys) sme_list; - /* + /* * linked list for the events that a device maintains. */ LIST_HEAD(, sme_event) sme_events_list; |
