From nobody Sat Apr 25 16:15:34 2026 X-Original-To: dev-commits-src-all@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 4g2w0k5SK3z6blLw for ; Sat, 25 Apr 2026 16:15:34 +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" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4g2w0k2DGmz3wyP for ; Sat, 25 Apr 2026 16:15:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1777133734; 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=M88akCbP6ayi/nso4iZ5toeQ7EplCM0nlVIOaQ1T2/0=; b=ipyi3CqGFeyd8kE/6clhN7Fmn9RNVS+j0mtcY6SxErP9SwzJQIFoEFQINA8WsWArgq7Ums g0mE/aPOj8D3BDP7BE3eD7XFG3iuPiRGSnXjeI8TlOuL9cuQ9Tir33glPMkIESJbkjkgo9 mKJgtpsBDAJAl0xgBPjVlYx+DMAOekXTta1MrKez/hbu0oFQbdMEtZkfqRNYuKhD6JiHaO 0HwCVDcN5is0tZJ0vFoFnin/BNOzE5Y/WxkUINwfU1QuVY+N0OJfklKyiEF0Rt5rLLcTp8 iGPkXoq9usRm9ybEX5e4p7ChLKCn+iOkKuLPZ+H78TS7+425vP/TEixDxdPLUQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1777133734; a=rsa-sha256; cv=none; b=xvDlXEyHD8Q1CQNgGzxLqhVTbRKGxc+cFMh/iQ0hTk6bZ5QTZROV70yUtpRoLhh7ld20lz vedVJMHuxArICd85bfkoMum9k496w94ZYQTyneymN5Ni2PQb3XNa6AZI/nzahi/VQjY8Rl QLmeMUQRhAEvm/GsPnWaO0Np92vclkVvTVsGsnB1oPlA0iQVG/AB19ig1iB5aZzyx4fuU/ pR8DGm0JkgFWOUxZBvS2WBKEttQ/zvzZlvwRYGgTA0vt99SwttLbi64x44jl+6RgI8+BFS zOg7sFo0cBYYV3zwME0o+8mtZkjEWamYnsUgBj5Ytf4WueZnjGuM/KvJ0d2Apg== 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=1777133734; 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=M88akCbP6ayi/nso4iZ5toeQ7EplCM0nlVIOaQ1T2/0=; b=wjJBelrpEKDMTY846RT5hUKy/gnHUA0OORutO6bMFn7uv/57MXgn80lXwJqZ4kMuOqtEYV weLD2V/zgT9kVKIlvAfKxaROWSRXOZHaCVp7IctW5xIpH33SMJ/KHFEvhTDBTM8EXvRgM/ B0NTfItxfqiv/ty8uM1pvUwo4xprFRG6QPn72rxyV7UJQRALYxy8daDTfX5y9MiX8PQpKx nvXjUw76j1runk+KGtG71O3Np5QgqS8XUdcImwJ1lUa7VqAfWAur55a0KeID+IscrkHz1l 6vS18fokCIGcf6E+z2jD58n6vsGN283P8O//ZZvC3jrGYf/wup0l5BM8x/3/kg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4g2w0k1jjTzh0P for ; Sat, 25 Apr 2026 16:15:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 43c97 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 25 Apr 2026 16:15:34 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Enji Cooper Subject: git: 67504e71521d - stable/15 - chore: asmc: use designated initializers in macros List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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/15 X-Git-Reftype: branch X-Git-Commit: 67504e71521d7806e3a6b67fe43da350839eabc8 Auto-Submitted: auto-generated Date: Sat, 25 Apr 2026 16:15:34 +0000 Message-Id: <69ece8a6.43c97.538f16d@gitrepo.freebsd.org> The branch stable/15 has been updated by ngie: URL: https://cgit.FreeBSD.org/src/commit/?id=67504e71521d7806e3a6b67fe43da350839eabc8 commit 67504e71521d7806e3a6b67fe43da350839eabc8 Author: Enji Cooper AuthorDate: 2026-02-20 06:31:21 +0000 Commit: Enji Cooper CommitDate: 2026-04-25 16:14:51 +0000 chore: asmc: use designated initializers in macros This code cleanup makes it easier for human readers to understand what each of the fields actually represents, as well as makes it easier to modify what the macros actually do under the covers, without introducing potential human errors. No functional change intended. MFC after: 1 week (cherry picked from commit ef1cde51032d395492caae302fedf183c58a482b) --- sys/dev/asmc/asmc.c | 61 +++++++++++++++++++++++++++++++++-------------------- 1 file changed, 38 insertions(+), 23 deletions(-) diff --git a/sys/dev/asmc/asmc.c b/sys/dev/asmc/asmc.c index b874599dcc81..756f4c12e43d 100644 --- a/sys/dev/asmc/asmc.c +++ b/sys/dev/asmc/asmc.c @@ -135,31 +135,46 @@ struct asmc_model { static const struct asmc_model *asmc_match(device_t dev); -#define ASMC_SMS_FUNCS asmc_mb_sysctl_sms_x, asmc_mb_sysctl_sms_y, \ - asmc_mb_sysctl_sms_z - -#define ASMC_SMS_FUNCS_DISABLED NULL, NULL, NULL - -#define ASMC_FAN_FUNCS asmc_mb_sysctl_fanid, asmc_mb_sysctl_fanspeed, asmc_mb_sysctl_fansafespeed, \ - asmc_mb_sysctl_fanminspeed, \ - asmc_mb_sysctl_fanmaxspeed, \ - asmc_mb_sysctl_fantargetspeed - -#define ASMC_FAN_FUNCS2 asmc_mb_sysctl_fanid, asmc_mb_sysctl_fanspeed, NULL, \ - asmc_mb_sysctl_fanminspeed, \ - asmc_mb_sysctl_fanmaxspeed, \ - asmc_mb_sysctl_fantargetspeed - -#define ASMC_LIGHT_FUNCS asmc_mbp_sysctl_light_left, \ - asmc_mbp_sysctl_light_right, \ - asmc_mbp_sysctl_light_control +#define ASMC_SMS_FUNCS \ + .smc_sms_x = asmc_mb_sysctl_sms_x, \ + .smc_sms_y = asmc_mb_sysctl_sms_y, \ + .smc_sms_z = asmc_mb_sysctl_sms_z + +#define ASMC_SMS_FUNCS_DISABLED \ + .smc_sms_x = NULL, \ + .smc_sms_y = NULL, \ + .smc_sms_z = NULL + +#define ASMC_FAN_FUNCS \ + .smc_fan_id = asmc_mb_sysctl_fanid, \ + .smc_fan_speed = asmc_mb_sysctl_fanspeed, \ + .smc_fan_safespeed = asmc_mb_sysctl_fansafespeed, \ + .smc_fan_minspeed = asmc_mb_sysctl_fanminspeed, \ + .smc_fan_maxspeed = asmc_mb_sysctl_fanmaxspeed, \ + .smc_fan_targetspeed = asmc_mb_sysctl_fantargetspeed + +#define ASMC_FAN_FUNCS2 \ + .smc_fan_id = asmc_mb_sysctl_fanid, \ + .smc_fan_speed = asmc_mb_sysctl_fanspeed, \ + .smc_fan_safespeed = NULL, \ + .smc_fan_minspeed = asmc_mb_sysctl_fanminspeed, \ + .smc_fan_maxspeed = asmc_mb_sysctl_fanmaxspeed, \ + .smc_fan_targetspeed = asmc_mb_sysctl_fantargetspeed + +#define ASMC_LIGHT_FUNCS \ + .smc_light_left = asmc_mbp_sysctl_light_left, \ + .smc_light_right = asmc_mbp_sysctl_light_right, \ + .smc_light_control = asmc_mbp_sysctl_light_control #define ASMC_LIGHT_FUNCS_10BYTE \ - asmc_mbp_sysctl_light_left_10byte, \ - NULL, \ - asmc_mbp_sysctl_light_control - -#define ASMC_LIGHT_FUNCS_DISABLED NULL, NULL, NULL + .smc_light_left = asmc_mbp_sysctl_light_left_10byte, \ + .smc_light_right = NULL, \ + .smc_light_control = asmc_mbp_sysctl_light_control + +#define ASMC_LIGHT_FUNCS_DISABLED \ + .smc_light_left = NULL, \ + .smc_light_right = NULL, \ + .smc_light_control = NULL #define ASMC_TEMPS_FUNCS_DISABLED \ .smc_temps = {}, \