From nobody Fri Dec 26 15:43:53 2025 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 4dd8zY6yKvz6LmFs for ; Fri, 26 Dec 2025 15:43:53 +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 4dd8zY4bRPz43KV for ; Fri, 26 Dec 2025 15:43:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766763833; 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=eYJ/pkZ0NXZeDn7U4PZ7ThWocG91cgMw2uBi58wkh4g=; b=fnnHpU+2Z8zHTl9aZY2HWIOFogyAe3SDB3xDUN19Ps7b0syg16m51JywMDK9l8yCz1jZc0 RRjT6dOQ2eIDhbr9BLFILTN1KndAYGY4j4ZSqdptciRrTtAlX0gcKg6dk90oJS0G4a3qUX kliQgcQ9+iGqlC+FbomM1LR9hlNnZhCztAzbfSJHMNwybZvHVdP9eMxZBPMfXHVC+BU12V 2HzDCfTrO2P9p1L3o/y9OEt7FEU2d+G13M6OWfmA8f68nMtc3hYTCIqrLyT4UCoGhkw/jw DsinRdZmnZc0zFpwzcstFl/J003+mRisM+678dMOgkJ9P/UigQ19Z8+kP6dJBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766763833; 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=eYJ/pkZ0NXZeDn7U4PZ7ThWocG91cgMw2uBi58wkh4g=; b=w+AiLZ8Zr1uh5tPTtBgfgtgvpMKOLYdnuvCCdFgSSsVH1WPSyLn60CTeq0Zz8VcqwfeAfX Y4kjjCouN8A6znb6gAMsaO+X5ycVAgwiD0D8eVf5ZYAp8cYHSHoTEiAkN3gA2iVJwZ8fHk kkUxLxyqzedUj64+t3Z+7hCTq/FFgkGgyr3eGNUhFsr+PDFQh7Dnsv+6+fI2A3GOvfYSfB 8Ub6QrrfUokgkl2d6bFC7Bnv5/N0orzIthTrxXVpycwrCvCx//qI2TBtFsL4qeViA99Utr qi0SVedj/xcJmt9q2QPiw40OmVeUh8iYo7C7et++CZNWBzNmbFRsvAa1plipxQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766763833; a=rsa-sha256; cv=none; b=vmA1ro8UjJiJObJupRCfwTDrYs7DqyE8J2FlMT5C6LLUC3u5mvxbJdwOyNbJVKLRFzjkb0 2B2vi6cbBjNKHDzn5IWEX61FazuaDACT0E+9E5pZ+K2OcHfC+p/M8U8au+RGFetxKQwPEB U3fmT2xVWFW4n8g+b2j/9ieXUVv6LGnOV1X9DOVWmqvgL6K7DPY5j2+wOZAjz1NSwpMYnZ G2O3mYk7VYI8jpp2Sy1dsZQ/paaqvqieZW7oeM3N7ihSB2DOb6x0GSYcn2e4SZJ7i8nw9X LvLWawEctnofehHtZey+JEZY0Bv1Q9ZYSJx8Wvj9dmLWBK0ctKpLiRDAaggVsw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dd8zY49X1z4W6 for ; Fri, 26 Dec 2025 15:43:53 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id c2cf by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 26 Dec 2025 15:43:53 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: 11757b1487e3 - main - acpi: Statically initialize acpi_ioctl_hooks 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: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 11757b1487e3e8ca0479dff5da0815b42aea3fe0 Auto-Submitted: auto-generated Date: Fri, 26 Dec 2025 15:43:53 +0000 Message-Id: <694ead39.c2cf.5746ec69@gitrepo.freebsd.org> The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=11757b1487e3e8ca0479dff5da0815b42aea3fe0 commit 11757b1487e3e8ca0479dff5da0815b42aea3fe0 Author: John Baldwin AuthorDate: 2025-12-26 15:37:10 +0000 Commit: John Baldwin CommitDate: 2025-12-26 15:37:10 +0000 acpi: Statically initialize acpi_ioctl_hooks Reviewed by: imp Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D54313 --- sys/dev/acpica/acpi.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index 0aae1db9e96e..8380f701d226 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -4197,8 +4197,8 @@ struct acpi_ioctl_hook void *arg; }; -static TAILQ_HEAD(,acpi_ioctl_hook) acpi_ioctl_hooks; -static int acpi_ioctl_hooks_initted; +static TAILQ_HEAD(,acpi_ioctl_hook) acpi_ioctl_hooks = + TAILQ_HEAD_INITIALIZER(acpi_ioctl_hooks); int acpi_register_ioctl(u_long cmd, acpi_ioctl_fn fn, void *arg) @@ -4211,10 +4211,6 @@ acpi_register_ioctl(u_long cmd, acpi_ioctl_fn fn, void *arg) hp->arg = arg; ACPI_LOCK(acpi); - if (acpi_ioctl_hooks_initted == 0) { - TAILQ_INIT(&acpi_ioctl_hooks); - acpi_ioctl_hooks_initted = 1; - } TAILQ_FOREACH(thp, &acpi_ioctl_hooks, link) { if (thp->cmd == cmd) { ACPI_UNLOCK(acpi); @@ -4274,11 +4270,10 @@ acpiioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *t * Scan the list of registered ioctls, looking for handlers. */ ACPI_LOCK(acpi); - if (acpi_ioctl_hooks_initted) - TAILQ_FOREACH(hp, &acpi_ioctl_hooks, link) { - if (hp->cmd == cmd) - break; - } + TAILQ_FOREACH(hp, &acpi_ioctl_hooks, link) { + if (hp->cmd == cmd) + break; + } ACPI_UNLOCK(acpi); if (hp) return (hp->fn(cmd, addr, hp->arg));