Page MenuHomeFreeBSD

D61302.1794354034.diff
No OneTemporary

Authored By
Unknown
Size
2 KB
Referenced Files
None
Subscribers
None

D61302.1794354034.diff

diff --git a/sys/dev/asmc/asmc.c b/sys/dev/asmc/asmc.c
--- a/sys/dev/asmc/asmc.c
+++ b/sys/dev/asmc/asmc.c
@@ -81,7 +81,8 @@
struct backlight_props *props);
static int asmc_backlight_get_status(device_t dev,
struct backlight_props *props);
-static int asmc_backlight_get_info(device_t dev, struct backlight_info *info);
+static int asmc_backlight_get_info(device_t dev,
+ struct backlight_info *info);
/*
* SMC functions.
@@ -236,7 +237,7 @@
/* Probe SMC keys to detect capabilities */
asmc_detect_capabilities(dev);
- /* Auto-detect and register voltage/current/power/ambient/temp sensors */
+ /* Auto-detect voltage/current/power/ambient/temp sensors */
asmc_detect_sensors(dev);
asmc_sysctl_add_fan(dev, sysctlctx);
diff --git a/sys/dev/asmc/asmc_debug.c b/sys/dev/asmc/asmc_debug.c
--- a/sys/dev/asmc/asmc_debug.c
+++ b/sys/dev/asmc/asmc_debug.c
@@ -145,9 +145,10 @@
return (EINVAL);
memset(sc->sc_rawval, 0, sizeof(sc->sc_rawval));
- for (i = 0; i < sc->sc_rawlen && hexbuf[i*2] && hexbuf[i*2+1]; i++) {
+ for (i = 0; i < sc->sc_rawlen && hexbuf[i * 2] &&
+ hexbuf[i * 2 + 1]; i++) {
unsigned int val;
- char tmp[3] = { hexbuf[i*2], hexbuf[i*2+1], 0 };
+ char tmp[3] = { hexbuf[i * 2], hexbuf[i * 2 + 1], 0 };
if (sscanf(tmp, "%02x", &val) == 1)
sc->sc_rawval[i] = (uint8_t)val;
}
diff --git a/sys/dev/asmc/asmc_pio.c b/sys/dev/asmc/asmc_pio.c
--- a/sys/dev/asmc/asmc_pio.c
+++ b/sys/dev/asmc/asmc_pio.c
@@ -218,7 +218,7 @@
/*
* Get key info (length and type) from SMC using command 0x13.
* If len is non-NULL, stores the key's value length.
- * If type is non-NULL, stores the 4-char type string (must be at least 5 bytes).
+ * If type is non-NULL, stores the 4-char type string; it needs 5 bytes.
*/
int
asmc_pio_key_getinfo(device_t dev, const char *key, uint8_t *len, char *type)
diff --git a/sys/dev/asmc/asmc_sysctl.c b/sys/dev/asmc/asmc_sysctl.c
--- a/sys/dev/asmc/asmc_sysctl.c
+++ b/sys/dev/asmc/asmc_sysctl.c
@@ -56,7 +56,7 @@
{ -2, "power-supply", NULL },
{ -3, "temperature-multisleep", NULL },
{ -4, "sensor-fan", NULL },
- { -30, "temperature-overlimit-timeout",NULL },
+ { -30, "temperature-overlimit-timeout", NULL },
{ -40, "pswr-smrst", NULL }, /* power supply watchdog reset */
{ -50, "unmapped", NULL },
{ -60, "low-battery", NULL },
@@ -823,10 +823,11 @@
val = (buf[0] << 8) | buf[1];
/* Modify single bit */
- if (v)
+ if (v) {
val |= (1 << fan); /* Set to manual */
- else
+ } else {
val &= ~(1 << fan); /* Set to auto */
+ }
/* Write back */
buf[0] = val >> 8;
diff --git a/sys/dev/asmc/asmcvar.h b/sys/dev/asmc/asmcvar.h
--- a/sys/dev/asmc/asmcvar.h
+++ b/sys/dev/asmc/asmcvar.h
@@ -51,7 +51,7 @@
int16_t sms_rest_x;
int16_t sms_rest_y;
int16_t sms_rest_z;
- struct sysctl_oid *sc_fan_tree[ASMC_MAXFANS+1];
+ struct sysctl_oid *sc_fan_tree[ASMC_MAXFANS + 1];
struct sysctl_oid *sc_temp_tree;
struct sysctl_oid *sc_sms_tree;
struct sysctl_oid *sc_light_tree;

File Metadata

Mime Type
text/plain
Expires
Tue, Nov 10, 11:40 PM (9 h, 24 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41615554
Default Alt Text
D61302.1794354034.diff (2 KB)

Event Timeline