From nobody Sat Apr 25 16:26:55 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 4g2wFr0R6Cz6blxs for ; Sat, 25 Apr 2026 16:26:56 +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 4g2wFq4Gqyz42cn for ; Sat, 25 Apr 2026 16:26:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1777134415; 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=yy7mOjJ2+RI97Sq82rJxxeloBWPK8JS/yCitQkQ/jRI=; b=h8GVuQ9XAiWmT+HV7QvwQlzvhD1BesR1dcksC9QewGt59DTu3ieA87kSejcMhZ1NyRvJH7 y+c/MZAXtfw715grxEo0GQOVD0WCqr8ajorn8E94A6t6oj0StXa0SjQGDWRt0HS1aOz6oo pPMrj+LpvpO7kHHkgHP3koPk31cPFkwArtkNCY7GwkpTPq01IeuDIcSmYWXsjrFxveitxP YyTi2cFHzOiVVNM1iOaqmnxF/knnZjxSf8RWDw6Hpl5MAJCDZRQ78VskfqIKB64iF6+bUd D/5fBpD2+BFa8CtDOQDXcS9ZR1IhjokRCXrNk1X0vZwKjt/B0rqZPZouny9Nzg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1777134415; a=rsa-sha256; cv=none; b=IxjrkTVNP7Wu9p/9o1HxXdfStqCdwsdyczxb/wlLQ0N1w45CZUMmiMlA1yKyn12jjXKZ9i tq0kh3oXZnaQoGU1byjlQ2Wgb1/JYagtLPC5uNzkRIARW7VYob8hEWp06EGJcmBTqQBYP1 uDM7K+DewzGwd91jkbc4n2te0H1rXF/UnRzXpAl1BdvDZw1l+r1miDjYITjXK4aMybTp9u Xkbq2YlKqrB0iW4cU9sFofuTq3goj9gq3FJA9Iil1PCO3yxg6Z5vRx7Y74Awg7mAZ23URS 0TG5SdhGqvR+pDr8qwsvGp4W1GaP2SNMZCKkbvg3dTuIpf3NFJDLbK53qvWaQQ== 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=1777134415; 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=yy7mOjJ2+RI97Sq82rJxxeloBWPK8JS/yCitQkQ/jRI=; b=BLmo8ihVUVZbC5a3HDpTfnzEiUAIYNIwlrJloqG/WgQl61JehgHX++uExQmQ5uPCjcwvZb RYz+JD1x4bcUSXT2d9sxgS5lZasYs1u19iY3ot6fencwPkURntSTsdRpCKTd/KghzCt0P7 PxS6+vL5kkWJqYwRnoZns4osnZzXNeA4tQRSyNp7pvxZ8GMFJpbZXs0s8E4JPTLJSDovuG xYEEN4KwwnRiYQFY+5spX2HWGKtHYiaL/DcCHN8k1pZSOOaHQashxGaLxyhbk7dq1RD45J ZVoqMjaOw1QGs+eyOAlqcTfKhbMQV0E6b7jSXieijqeHOtr+i8/8DtIn+30bfg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4g2wFq3tCjzh0m for ; Sat, 25 Apr 2026 16:26:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 43960 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 25 Apr 2026 16:26:55 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Enji Cooper Subject: git: 9dbe7570c275 - stable/14 - 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/14 X-Git-Reftype: branch X-Git-Commit: 9dbe7570c27513c0e5f8ea57c1994740cad10e92 Auto-Submitted: auto-generated Date: Sat, 25 Apr 2026 16:26:55 +0000 Message-Id: <69eceb4f.43960.4ac957a9@gitrepo.freebsd.org> The branch stable/14 has been updated by ngie: URL: https://cgit.FreeBSD.org/src/commit/?id=9dbe7570c27513c0e5f8ea57c1994740cad10e92 commit 9dbe7570c27513c0e5f8ea57c1994740cad10e92 Author: Enji Cooper AuthorDate: 2026-02-20 06:31:21 +0000 Commit: Enji Cooper CommitDate: 2026-04-25 16:25:43 +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 91a4ebe454ae..079689e2ec2b 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 = {}, \