From nobody Sun Feb 8 20:07:42 2026 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4f8Jlf3Xxpz6RhHt for ; Sun, 08 Feb 2026 20:07:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4f8Jlf31Jgz4DQ3 for ; Sun, 08 Feb 2026 20:07:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1770581262; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CnvPfyvnC3oayxLGnrdH4TjPNqbSBSvm9Oob9YwqwF8=; b=YG0VATN9SSGJIhbWwOizBDjlxb0ysFxIzhJVtvlr0NsT2oT+9IWU9SFRNk0IqGIOmqNgY3 jgcTm8e5XhOMTixEv8UjEihwvIgXDw2+fpMCuyBT34x41I6r5kcBpScJsd4ntCBzzse+ys VnoJi8AKLw88A2SwqD41K+9RSjuXHKB/Xf6+xk5iBIdCfY7afJJ5f/vkIPI4vAKdVpnyVN cTdiVfMzz/viUWeFxq0wqT33lFoijq71hhJzcz+vIm+FPbYnQDhbwuVdym7haqOWX0sbl9 Bqkqz73jR4fwTVfI8FkeXdVjJXB1gMJvZkTikCTJ9rY6vdfM8O+T0u2A2Kh/Xw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1770581262; a=rsa-sha256; cv=none; b=McytRjo+/V9GPRDrFMWXvv1eY1eqY45f7cJJd5cc3p5KPZjYI5aIg9GTzdIFuDx3ELCiAk GlZdmtvH8lkyIQgz/xdwo8vG2E55g2BaYkWgueVYfKD6Uo6W6cQSIM4IGwdcmhT+VdMUQe BF/ICzNwhY54D0fj89x+M/Fm9lQsp3M5NZNUluolnB8IQ4IoGOTPeU9E9aYGxx0XovloXC Aprj7L23kBSkGrbSnCqBUfenjPVpYkPfI88e1Ttbbog7kalHjyVA9poBL+9H9q/Y9z7plv YJIQ3tfwQsi+krmLWYkGl2wLpF0VLLc2LfvZpmnRbu33hWX4eSpBLo/OrtmD5g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1770581262; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CnvPfyvnC3oayxLGnrdH4TjPNqbSBSvm9Oob9YwqwF8=; b=EQHnZnVZMPuKisGb35faqTeVXNrc1SKa38qSa3XA0F3MGmvlF9U9vSrl1dzwHvFZkl+JGw aki9bdGRolaW8EBZfHY8EHB5HU9BHfBs1MPmgF1Rs/8fz4wekkGKcq+syflfSsjVkXSQRE jdgSNrbb1smA9hrwliR2BVBR2gUFds1rdQpP+BsF238qB1VOk1XAnkQgASa0EF5aCyBpyy i0asjYuouMKxXIbIquJ6hNo+LlDhRMl5MphrRVX/YLZGvltS91O/GE990UczZXolgfFng/ xVeTb3KqE7kDTnv4nTIPbroEy6Icv1XunpUEC5xhzKaB1HTosop+B3UbG9gaZA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4f8Jlf2Kzqz11gd for ; Sun, 08 Feb 2026 20:07:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3bdf0 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 08 Feb 2026 20:07:42 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Enji Cooper Subject: git: d76bb14e0224 - main - chore: asmc: additional style(9) cleanup List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ngie X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d76bb14e0224e235209d8c07ec132d602b18648b Auto-Submitted: auto-generated Date: Sun, 08 Feb 2026 20:07:42 +0000 Message-Id: <6988ed0e.3bdf0.24dc57ec@gitrepo.freebsd.org> The branch main has been updated by ngie: URL: https://cgit.FreeBSD.org/src/commit/?id=d76bb14e0224e235209d8c07ec132d602b18648b commit d76bb14e0224e235209d8c07ec132d602b18648b Author: Enji Cooper AuthorDate: 2026-02-08 20:04:32 +0000 Commit: Enji Cooper CommitDate: 2026-02-08 20:07:30 +0000 chore: asmc: additional style(9) cleanup Pick out non-gratuitous style(9) changes suggested by `clang-format` on the driver. This helps eliminate minor stylistic issues with spaces, braces, line lengths, etc, so future functional changes in the driver will be easier to pick out. Many of the other `clang-format` suggested changes were not taken because they were considerably more gratuitous. No functional change intended. MFC after: 1 week --- sys/dev/asmc/asmc.c | 105 ++++++++++++++++++++++++++++------------------------ 1 file changed, 56 insertions(+), 49 deletions(-) diff --git a/sys/dev/asmc/asmc.c b/sys/dev/asmc/asmc.c index a9f2555b79c6..f2c42ba814e2 100644 --- a/sys/dev/asmc/asmc.c +++ b/sys/dev/asmc/asmc.c @@ -110,8 +110,8 @@ static int asmc_mbp_sysctl_light_control(SYSCTL_HANDLER_ARGS); static int asmc_mbp_sysctl_light_left_10byte(SYSCTL_HANDLER_ARGS); struct asmc_model { - const char *smc_model; /* smbios.system.product env var. */ - const char *smc_desc; /* driver description */ + const char *smc_model; /* smbios.system.product env var. */ + const char *smc_desc; /* driver description */ /* Helper functions */ int (*smc_sms_x)(SYSCTL_HANDLER_ARGS); @@ -599,7 +599,7 @@ asmc_attach(device_t dev) return (ENOMEM); } - sysctlctx = device_get_sysctl_ctx(dev); + sysctlctx = device_get_sysctl_ctx(dev); sysctlnode = device_get_sysctl_tree(dev); model = asmc_match(dev); @@ -774,8 +774,8 @@ asmc_attach(device_t dev) * Allocate an IRQ for the SMS. */ sc->sc_rid_irq = 0; - sc->sc_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, - &sc->sc_rid_irq, RF_ACTIVE); + sc->sc_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &sc->sc_rid_irq, + RF_ACTIVE); if (sc->sc_irq == NULL) { device_printf(dev, "unable to allocate IRQ resource\n"); ret = ENXIO; @@ -840,7 +840,8 @@ asmc_resume(device_t dev) } #ifdef ASMC_DEBUG -void asmc_dumpall(device_t dev) +void +asmc_dumpall(device_t dev) { struct asmc_softc *sc = device_get_softc(dev); int i; @@ -945,7 +946,8 @@ nosms: if (asmc_key_read(dev, ASMC_NKEYS, buf, 4) == 0) { sc->sc_nkeys = be32dec(buf); if (bootverbose) - device_printf(dev, "number of keys: %d\n", sc->sc_nkeys); + device_printf(dev, "number of keys: %d\n", + sc->sc_nkeys); } else { sc->sc_nkeys = 0; } @@ -1009,11 +1011,12 @@ asmc_wait(device_t dev, uint8_t val) * the acknowledgement fails. */ static int -asmc_command(device_t dev, uint8_t command) { +asmc_command(device_t dev, uint8_t command) +{ int i; struct asmc_softc *sc = device_get_softc(dev); - for (i=0; i < 10; i++) { + for (i = 0; i < 10; i++) { ASMC_CMDPORT_WRITE(sc, command); if (asmc_wait_ack(dev, 0x0c, 100) == 0) { return (0); @@ -1056,9 +1059,10 @@ begin: error = 0; out: if (error) { - if (++try < 10) goto begin; - device_printf(dev,"%s for key %s failed %d times, giving up\n", - __func__, key, try); + if (++try < 10) + goto begin; + device_printf(dev, "%s for key %s failed %d times, giving up\n", + __func__, key, try); } mtx_unlock_spin(&sc->sc_mtx); @@ -1124,11 +1128,11 @@ begin: error = 0; out: if (error) { - if (++try < 10) goto begin; - device_printf(dev,"%s for key %s failed %d times, giving up\n", - __func__, key, try); + if (++try < 10) + goto begin; + device_printf(dev, "%s for key %s failed %d times, giving up\n", + __func__, key, try); mtx_unlock_spin(&sc->sc_mtx); - } else { char buf[1024]; char buf2[8]; @@ -1192,15 +1196,15 @@ begin: error = 0; out: if (error) { - if (++try < 10) goto begin; - device_printf(dev,"%s for key %s failed %d times, giving up\n", - __func__, key, try); + if (++try < 10) + goto begin; + device_printf(dev, "%s for key %s failed %d times, giving up\n", + __func__, key, try); } mtx_unlock_spin(&sc->sc_mtx); return (error); - } /* @@ -1232,16 +1236,17 @@ asmc_fan_getvalue(device_t dev, const char *key, int fan) return (speed); } -static char* -asmc_fan_getstring(device_t dev, const char *key, int fan, uint8_t *buf, uint8_t buflen) +static char * +asmc_fan_getstring(device_t dev, const char *key, int fan, uint8_t *buf, + uint8_t buflen) { char fankey[5]; - char* desc; + char *desc; snprintf(fankey, sizeof(fankey), key, fan); if (asmc_key_read(dev, fankey, buf, buflen) != 0) return (NULL); - desc = buf+4; + desc = buf + 4; return (desc); } @@ -1254,7 +1259,7 @@ asmc_fan_setvalue(device_t dev, const char *key, int fan, int speed) speed *= 4; - buf[0] = speed>>8; + buf[0] = speed >> 8; buf[1] = speed; snprintf(fankey, sizeof(fankey), key, fan); @@ -1267,7 +1272,7 @@ asmc_fan_setvalue(device_t dev, const char *key, int fan, int speed) static int asmc_mb_sysctl_fanspeed(SYSCTL_HANDLER_ARGS) { - device_t dev = (device_t) arg1; + device_t dev = (device_t)arg1; int fan = arg2; int error; int32_t v; @@ -1282,10 +1287,10 @@ static int asmc_mb_sysctl_fanid(SYSCTL_HANDLER_ARGS) { uint8_t buf[16]; - device_t dev = (device_t) arg1; + device_t dev = (device_t)arg1; int fan = arg2; int error = true; - char* desc; + char *desc; desc = asmc_fan_getstring(dev, ASMC_KEY_FANID, fan, buf, sizeof(buf)); @@ -1298,7 +1303,7 @@ asmc_mb_sysctl_fanid(SYSCTL_HANDLER_ARGS) static int asmc_mb_sysctl_fansafespeed(SYSCTL_HANDLER_ARGS) { - device_t dev = (device_t) arg1; + device_t dev = (device_t)arg1; int fan = arg2; int error; int32_t v; @@ -1312,7 +1317,7 @@ asmc_mb_sysctl_fansafespeed(SYSCTL_HANDLER_ARGS) static int asmc_mb_sysctl_fanminspeed(SYSCTL_HANDLER_ARGS) { - device_t dev = (device_t) arg1; + device_t dev = (device_t)arg1; int fan = arg2; int error; int32_t v; @@ -1331,7 +1336,7 @@ asmc_mb_sysctl_fanminspeed(SYSCTL_HANDLER_ARGS) static int asmc_mb_sysctl_fanmaxspeed(SYSCTL_HANDLER_ARGS) { - device_t dev = (device_t) arg1; + device_t dev = (device_t)arg1; int fan = arg2; int error; int32_t v; @@ -1350,7 +1355,7 @@ asmc_mb_sysctl_fanmaxspeed(SYSCTL_HANDLER_ARGS) static int asmc_mb_sysctl_fantargetspeed(SYSCTL_HANDLER_ARGS) { - device_t dev = (device_t) arg1; + device_t dev = (device_t)arg1; int fan = arg2; int error; int32_t v; @@ -1369,7 +1374,7 @@ asmc_mb_sysctl_fantargetspeed(SYSCTL_HANDLER_ARGS) static int asmc_mb_sysctl_fanmanual(SYSCTL_HANDLER_ARGS) { - device_t dev = (device_t) arg1; + device_t dev = (device_t)arg1; int fan = arg2; int error; int32_t v; @@ -1393,7 +1398,8 @@ asmc_mb_sysctl_fanmanual(SYSCTL_HANDLER_ARGS) if (v != 0 && v != 1) return (EINVAL); /* Read-modify-write of FS! bitmask */ - error = asmc_key_read(dev, ASMC_KEY_FANMANUAL, buf, sizeof(buf)); + error = asmc_key_read(dev, ASMC_KEY_FANMANUAL, buf, + sizeof(buf)); if (error == 0) { val = (buf[0] << 8) | buf[1]; @@ -1406,7 +1412,8 @@ asmc_mb_sysctl_fanmanual(SYSCTL_HANDLER_ARGS) /* Write back */ buf[0] = val >> 8; buf[1] = val & 0xff; - error = asmc_key_write(dev, ASMC_KEY_FANMANUAL, buf, sizeof(buf)); + error = asmc_key_write(dev, ASMC_KEY_FANMANUAL, buf, + sizeof(buf)); } } @@ -1433,7 +1440,7 @@ asmc_temp_getvalue(device_t dev, const char *key) static int asmc_temp_sysctl(SYSCTL_HANDLER_ARGS) { - device_t dev = (device_t) arg1; + device_t dev = (device_t)arg1; struct asmc_softc *sc = device_get_softc(dev); int error, val; @@ -1457,11 +1464,11 @@ asmc_sms_read(device_t dev, const char *key, int16_t *val) case 'X': case 'Y': case 'Z': - error = asmc_key_read(dev, key, buf, sizeof buf); + error = asmc_key_read(dev, key, buf, sizeof buf); break; default: device_printf(dev, "%s called with invalid argument %s\n", - __func__, key); + __func__, key); error = 1; goto out; } @@ -1484,7 +1491,7 @@ static int asmc_sms_intrfast(void *arg) { uint8_t type; - device_t dev = (device_t) arg; + device_t dev = (device_t)arg; struct asmc_softc *sc = device_get_softc(dev); if (!sc->sc_sms_intr_works) return (FILTER_HANDLED); @@ -1557,13 +1564,13 @@ asmc_sms_task(void *arg, int pending) static int asmc_mb_sysctl_sms_x(SYSCTL_HANDLER_ARGS) { - device_t dev = (device_t) arg1; + device_t dev = (device_t)arg1; int error; int16_t val; int32_t v; asmc_sms_read(dev, ASMC_KEY_SMS_X, &val); - v = (int32_t) val; + v = (int32_t)val; error = sysctl_handle_int(oidp, &v, 0, req); return (error); @@ -1572,13 +1579,13 @@ asmc_mb_sysctl_sms_x(SYSCTL_HANDLER_ARGS) static int asmc_mb_sysctl_sms_y(SYSCTL_HANDLER_ARGS) { - device_t dev = (device_t) arg1; + device_t dev = (device_t)arg1; int error; int16_t val; int32_t v; asmc_sms_read(dev, ASMC_KEY_SMS_Y, &val); - v = (int32_t) val; + v = (int32_t)val; error = sysctl_handle_int(oidp, &v, 0, req); return (error); @@ -1587,13 +1594,13 @@ asmc_mb_sysctl_sms_y(SYSCTL_HANDLER_ARGS) static int asmc_mb_sysctl_sms_z(SYSCTL_HANDLER_ARGS) { - device_t dev = (device_t) arg1; + device_t dev = (device_t)arg1; int error; int16_t val; int32_t v; asmc_sms_read(dev, ASMC_KEY_SMS_Z, &val); - v = (int32_t) val; + v = (int32_t)val; error = sysctl_handle_int(oidp, &v, 0, req); return (error); @@ -1602,7 +1609,7 @@ asmc_mb_sysctl_sms_z(SYSCTL_HANDLER_ARGS) static int asmc_mbp_sysctl_light_left(SYSCTL_HANDLER_ARGS) { - device_t dev = (device_t) arg1; + device_t dev = (device_t)arg1; uint8_t buf[6]; int error; int32_t v; @@ -1617,7 +1624,7 @@ asmc_mbp_sysctl_light_left(SYSCTL_HANDLER_ARGS) static int asmc_mbp_sysctl_light_right(SYSCTL_HANDLER_ARGS) { - device_t dev = (device_t) arg1; + device_t dev = (device_t)arg1; uint8_t buf[6]; int error; int32_t v; @@ -1632,7 +1639,7 @@ asmc_mbp_sysctl_light_right(SYSCTL_HANDLER_ARGS) static int asmc_mbp_sysctl_light_control(SYSCTL_HANDLER_ARGS) { - device_t dev = (device_t) arg1; + device_t dev = (device_t)arg1; uint8_t buf[2]; int error; int v; @@ -1654,7 +1661,7 @@ asmc_mbp_sysctl_light_control(SYSCTL_HANDLER_ARGS) static int asmc_mbp_sysctl_light_left_10byte(SYSCTL_HANDLER_ARGS) { - device_t dev = (device_t) arg1; + device_t dev = (device_t)arg1; uint8_t buf[10]; int error; uint32_t v;