From nobody Sun Feb 22 04:30:37 2026 X-Original-To: dev-commits-src-branches@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 4fJWHx4kRLz6Sw0n for ; Sun, 22 Feb 2026 04:30:37 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fJWHx1pVzz3dg3 for ; Sun, 22 Feb 2026 04:30:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1771734637; 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=Yzk6oZ8MpjkpVt/78IXfwQbnw/hbuf66ifK7b/q9mfE=; b=vF69PzfSMNkHcSELAwucx355cXN3KKlHwSbearUCJk39lQsFBsutkvM02VKmeITjIpuzFF lAhjFExnl5utdmm/E3GXyMMOUfpaaDz5LO2x4Wp/2q6bDPFnIz9UYQ+K8f5cnH6hm7EFli hQxIXlHh2Ldj+QnTAb1/4Eb1eiBoQtGoFuLSSSjOZr73P3yqP3sQ3MF87t6UpQV5kCjHH9 HLnXdFkcMOtVHES+KPZNHBGZ4osmdshc7CKZUL6K3hv17oEHqRBx/AC1QoDHjxJHu+yKLV 6epejiXUOkYSSRBNr8dr6PKz7s1lQ9EGSM9ktbe0fSWGDpn+LGjx0sirc6uQzA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1771734637; a=rsa-sha256; cv=none; b=I6dlckqHqvJXZytItoUYSYAimmdAOkTnZ88ZTHreqpZ8Dyyto5exI1euNELAoEKb7PPdhC jhgVMtjpo0EEI3514R+mnmGvX+ky2A7PnGNoAg8OO7fY3SuwK8kb9HOc9Edx3U4V+EHkhk fsuU/MD8hJSYgwcWgydaFyUZEi1PtL67U1UVTLC9h4eH5PARZl9QjStNluDbPAxUYemC2L +hJvlvoXimTEXt0+ZLHcxTOPUr3pTTQ6MPMqQcuiBeUoFAcDBx0OP9jrCzWQPTES35x8Vz bb4QLKesY82urXaWzs62pFJCD4aTDb/Mzu84DLbBnyiFf3na0LWGX/q7nJhSfQ== 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=1771734637; 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=Yzk6oZ8MpjkpVt/78IXfwQbnw/hbuf66ifK7b/q9mfE=; b=H7Mi1LjwDUMTQTxDOgxgRG7DQPF8gTvI6WuyMIOggFBaaFzGccoJoY6iy33Z9ozkpMJvs9 Vn3PwG3rEC/KnCScAixydWtfbwe8lqUAiVTSyStLyglKqNgY93V8L0QIshit6Fi6+5XZtj 6qdatzLAAvAj2xIhebt9hkAcrapuh4R907Fy1OOILzrZwsQoFbXLDmVhaE9l6pei663byL fF5uG3j29X+tJLMyBReCfyFZQHPLzUa6uOmgTph7N2LKkPho9E50rTtNKXXyDhwBtHPad8 bno6uwCfohSccc9BW1dVm1R36K0B4ybQUfGxOtRUQA/tHjQJ2rPiMPF7iojLLw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fJWHx1D2nzCyJ for ; Sun, 22 Feb 2026 04:30:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 27020 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 22 Feb 2026 04:30:37 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Enji Cooper Subject: git: c20013933af9 - stable/14 - chore: asmc: additional style(9) cleanup List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: c20013933af90ed377497769bf66eaf276b5c6c2 Auto-Submitted: auto-generated Date: Sun, 22 Feb 2026 04:30:37 +0000 Message-Id: <699a866d.27020.5d10e50e@gitrepo.freebsd.org> The branch stable/14 has been updated by ngie: URL: https://cgit.FreeBSD.org/src/commit/?id=c20013933af90ed377497769bf66eaf276b5c6c2 commit c20013933af90ed377497769bf66eaf276b5c6c2 Author: Enji Cooper AuthorDate: 2026-02-08 20:04:32 +0000 Commit: Enji Cooper CommitDate: 2026-02-22 04:30:04 +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 (cherry picked from commit d76bb14e0224e235209d8c07ec132d602b18648b) --- 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 114f4130d8ce..2a973be2e95c 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); @@ -581,7 +581,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); @@ -756,8 +756,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; @@ -820,7 +820,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; @@ -925,7 +926,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; } @@ -989,11 +991,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); @@ -1036,9 +1039,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); @@ -1104,11 +1108,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]; @@ -1172,15 +1176,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); - } /* @@ -1212,16 +1216,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); } @@ -1234,7 +1239,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); @@ -1247,7 +1252,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; @@ -1262,10 +1267,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)); @@ -1278,7 +1283,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; @@ -1292,7 +1297,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; @@ -1311,7 +1316,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; @@ -1330,7 +1335,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; @@ -1349,7 +1354,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; @@ -1373,7 +1378,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]; @@ -1386,7 +1392,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)); } } @@ -1413,7 +1420,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; @@ -1437,11 +1444,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; } @@ -1464,7 +1471,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); @@ -1537,13 +1544,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); @@ -1552,13 +1559,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); @@ -1567,13 +1574,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); @@ -1582,7 +1589,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; @@ -1597,7 +1604,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; @@ -1612,7 +1619,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; @@ -1634,7 +1641,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;