From nobody Wed May 13 12:39:38 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 4gFtMG6HZTz6dL9H for ; Wed, 13 May 2026 12:39:38 +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 4gFtMG4pD7z3vS9 for ; Wed, 13 May 2026 12:39:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1778675978; 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=dbUHUuJaLELGZ7j7wniwGfVNiol2bzqkTxEAADKqtLY=; b=K/Aatu9oQnvWZNgyDdBniFomgem0G7r9RzyhJ32EjQh+QJvXlKpo/fDwOzNdXnl1kcEtrq kIti03fDrKhLmmvx9XYP7bHW5ZAC+lucEpQXJ95Wjkf9noh9PwI6K+2vwU8Jxz6peu6BZ4 RniOOqerLk1taxIqoHZy5FK7XnyAfVOhQX+yedL4E4IacIpqPT4/2zaHKE79TF0V0g0yBX taU1B4BA7g6p1DedNRNw864mJBo1RfBRL/hmhO2kRu60PWf2PFbaNndR9nVQzl39Iiqjcb /R1oXoHV1Vi4ZJYOMuWL0RHSviQUeFeGoS8TeMg8VugeRRR9FIk8saBA2IOozA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1778675978; a=rsa-sha256; cv=none; b=NJ96AYSfaon4mIYBYB0qthukNW3EI6VLd3/s9soR0+Zm+jiAnHMIr8Ec4kw2C2J8QndMmw BhGs9cDoz5l88IVfck2QyUHzo14wKNSzjSHpZEjELIFQdr97PWB3IIdfmIAXvsDtnk3ksv dRgMURugjOedOs7DEbvPV8d/i47+CjSHOhUt6eQUsoKaUBFpSh50kBD04wlGZiHhoB70ip KHC+qF/hO5v54qqbBabsrLdAAnDHaqC23T0/5hs/ntwqZQiQ+riFXvhW9UbuSiwRcUiyCR fIVImvvxOevpVWKm2l1/5rVB3O5+9U4prKgvqHEkiEN6yz+CP580m1Dc2ZanqQ== 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=1778675978; 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=dbUHUuJaLELGZ7j7wniwGfVNiol2bzqkTxEAADKqtLY=; b=SIOOtoIJm2B4HoMYGA3TX+cqJ5rFVGt/jhD10sDQeRdFgNSdyehvpH2U7UoXr/rpLGYCit ENRp5uI9Q1/GXNgu7UKvdPk0dSeEqhIAycOxteoT39QXeYkuSyNt1lAtfJz7bRZnliNdma wcG5DgpEOoI4eQXaX8QhdI95du9JRmC2L7HA+qqzkdbqZPdb6wjqB68UONcrDL0SDnzfyx XxCjFhD0ADgwmej5EH193zato0MteEv0vJCnWBhWxrkfWGLaZi8ZWVZKB6KlJ+iBth7pXI dKjh46J0FI/6azmGOUohFfN9DFglhfA3Wafs8knykc3VFEDGid753bZi9TKqzw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gFtMG4P4jzrDx for ; Wed, 13 May 2026 12:39:38 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 195ed by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 13 May 2026 12:39:38 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: a648c45c9dc1 - main - acpi_spmc(4): Factor out code to test for a DSM's presence 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a648c45c9dc13de0457ea51d1ebd333b06ccff8e Auto-Submitted: auto-generated Date: Wed, 13 May 2026 12:39:38 +0000 Message-Id: <6a04710a.195ed.44ed3b8@gitrepo.freebsd.org> The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=a648c45c9dc13de0457ea51d1ebd333b06ccff8e commit a648c45c9dc13de0457ea51d1ebd333b06ccff8e Author: Olivier Certner AuthorDate: 2026-05-04 13:16:08 +0000 Commit: Olivier Certner CommitDate: 2026-05-13 12:38:19 +0000 acpi_spmc(4): Factor out code to test for a DSM's presence ...through a new function has_dsm(), which slightly simplifies reading. No functional change (intended). Reviewed by: obiwac, imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D56801 --- sys/dev/acpica/acpi_spmc.c | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/sys/dev/acpica/acpi_spmc.c b/sys/dev/acpica/acpi_spmc.c index b13e78b8000b..478887660e16 100644 --- a/sys/dev/acpica/acpi_spmc.c +++ b/sys/dev/acpica/acpi_spmc.c @@ -172,6 +172,12 @@ struct acpi_spmc_softc { struct acpi_spmc_constraint *constraints; }; +static bool +has_dsm(const struct acpi_spmc_softc *const sc, const int dsm_set_bit) +{ + return ((sc->dsm_sets & dsm_set_bit) != 0); +} + static void acpi_spmc_check_dsm_set(struct acpi_spmc_softc *sc, ACPI_HANDLE handle, struct dsm_set *dsm_set); static int acpi_spmc_get_constraints(device_t dev); @@ -442,7 +448,7 @@ acpi_spmc_get_constraints(device_t dev) return (0); /* The Microsoft DSM set doesn't have this DSM. */ - is_amd = (sc->dsm_sets & DSM_SET_AMD) != 0; + is_amd = has_dsm(sc, DSM_SET_AMD); if (is_amd) { dsm_set = &amd_dsm_set; dsm_index.amd = AMD_DSM_GET_DEVICE_CONSTRAINTS; @@ -562,11 +568,11 @@ acpi_spmc_display_off_notif(device_t dev) { struct acpi_spmc_softc *sc = device_get_softc(dev); - if ((sc->dsm_sets & DSM_SET_INTEL) != 0) + if (has_dsm(sc, DSM_SET_INTEL)) acpi_spmc_run_dsm(dev, &intel_dsm_set, DSM_DISPLAY_OFF_NOTIF); - if ((sc->dsm_sets & DSM_SET_MS) != 0) + if (has_dsm(sc, DSM_SET_MS)) acpi_spmc_run_dsm(dev, &ms_dsm_set, DSM_DISPLAY_OFF_NOTIF); - if ((sc->dsm_sets & DSM_SET_AMD) != 0) + if (has_dsm(sc, DSM_SET_AMD)) acpi_spmc_run_dsm(dev, &amd_dsm_set, AMD_DSM_DISPLAY_OFF_NOTIF); } @@ -575,11 +581,11 @@ acpi_spmc_display_on_notif(device_t dev) { struct acpi_spmc_softc *sc = device_get_softc(dev); - if ((sc->dsm_sets & DSM_SET_INTEL) != 0) + if (has_dsm(sc, DSM_SET_INTEL)) acpi_spmc_run_dsm(dev, &intel_dsm_set, DSM_DISPLAY_ON_NOTIF); - if ((sc->dsm_sets & DSM_SET_MS) != 0) + if (has_dsm(sc, DSM_SET_MS)) acpi_spmc_run_dsm(dev, &ms_dsm_set, DSM_DISPLAY_ON_NOTIF); - if ((sc->dsm_sets & DSM_SET_AMD) != 0) + if (has_dsm(sc, DSM_SET_AMD)) acpi_spmc_run_dsm(dev, &amd_dsm_set, AMD_DSM_DISPLAY_ON_NOTIF); } @@ -590,13 +596,13 @@ acpi_spmc_entry_notif(device_t dev) acpi_spmc_check_constraints(sc); - if ((sc->dsm_sets & DSM_SET_AMD) != 0) + if (has_dsm(sc, DSM_SET_AMD)) acpi_spmc_run_dsm(dev, &amd_dsm_set, AMD_DSM_ENTRY_NOTIF); - if ((sc->dsm_sets & DSM_SET_MS) != 0) { + if (has_dsm(sc, DSM_SET_MS)) { acpi_spmc_run_dsm(dev, &ms_dsm_set, DSM_MODERN_ENTRY_NOTIF); acpi_spmc_run_dsm(dev, &ms_dsm_set, DSM_ENTRY_NOTIF); } - if ((sc->dsm_sets & DSM_SET_INTEL) != 0) + if (has_dsm(sc, DSM_SET_INTEL)) acpi_spmc_run_dsm(dev, &intel_dsm_set, DSM_ENTRY_NOTIF); } @@ -605,11 +611,11 @@ acpi_spmc_exit_notif(device_t dev) { struct acpi_spmc_softc *sc = device_get_softc(dev); - if ((sc->dsm_sets & DSM_SET_INTEL) != 0) + if (has_dsm(sc, DSM_SET_INTEL)) acpi_spmc_run_dsm(dev, &intel_dsm_set, DSM_EXIT_NOTIF); - if ((sc->dsm_sets & DSM_SET_AMD) != 0) + if (has_dsm(sc, DSM_SET_AMD)) acpi_spmc_run_dsm(dev, &amd_dsm_set, AMD_DSM_EXIT_NOTIF); - if ((sc->dsm_sets & DSM_SET_MS) != 0) { + if (has_dsm(sc, DSM_SET_MS)) { acpi_spmc_run_dsm(dev, &ms_dsm_set, DSM_EXIT_NOTIF); if (ms_dsm_set.dsms_supported & (1 << DSM_MODERN_TURN_ON_DISPLAY))