From nobody Sun Jun 09 14:12:10 2024 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 4VxxhV5M6Tz5MCMx; Sun, 09 Jun 2024 14:12:10 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VxxhV2hRZz4DMf; Sun, 9 Jun 2024 14:12:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717942330; 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=CdJEpxGoPXU5Pz+wrV0rnh7R6kzguiinuQFB5kjXlxE=; b=Ewu8qtzI1wnxVnKEMR0upmjm5/1a0H90KEBWPAviCwMRZZMTRetWw5g6wyzmWHB/V8Axny nyqI+fcw7aZjxnZqkFI1z9M//2Nh/osDIP7gj+9eezcCQRHE2zPBXZIjIybky4cyaBrcDw SR57BNmKeAP5CRbCKrIhinbyDiGw0107XnKrFLoyBp6NP3mZc7LSEP0IHbA7fg+3wsa3u4 /FY+p03NBfvIycEmN1kQDvRKrKnCEM5UD6+1BKFWhO8BXBRYcgJb3z0zhTRkoECBQocYIZ zJXoqX1xEHQGieZv0RAbgj970WdrZKkUFv7T+dKc5BbnCGFljz2Cz4vuKr5MUw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717942330; a=rsa-sha256; cv=none; b=H9HgWU4yrSTkCvVIX2ovRWBIkZ/f7RTOngNprxx6YnEYcf+ReLSXkt5jcAMDmXeowoKiT6 2Pxzem20oQtMSatP3npyf99KooNMf+D50vAob4525wvJEpo6hAPXeZTo5IM7O2Otb0XfeA uJm642sgsolTFsMaV5JF4JeXrvPdsqwuwNqsbsIOCf43nE2evsXsipwBib86thCmus7uwD epGSK6fNzZhxkHqMwR6FF/O5WtIKET++jb9c9vCg6y7RHGD6K19ha1Ym7y1FRhhL61sXVy Cvva2gJAOaU7Nv7bivmqAdl3OUQ/Dv8P7SvY7kWrZKdMFuh2ZLk2xrjWFicNRA== 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=1717942330; 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=CdJEpxGoPXU5Pz+wrV0rnh7R6kzguiinuQFB5kjXlxE=; b=vFZSMOgAjAkoQrJKAgqZQSfDVdJQZ9uGyPRzZMBnOIZ9cqWwD5qeVO4L34tdQB3dhY486n FWOtHQTl+Rhy30XZo2vUMe/wVxxJMo7Bjw/nK3whX+eCF2/fs9AAw0X85tqyDl6vSQIxTh MFW0Y61zBCHZ7b8YjquLLyu4QBrHWzcfqKRc2P4hrC2c9vkj737lC11LCwJmRQlHTT3hth IMvI3819hhUH1Z3HHl2DYeHfZvvRIIwNmZN48U0LhnYwX8Ic1vkyDeNhSTEtJGl0ist58q sUHJMD9X7lQgnSRYrwhNXnQv3VS3nCSledNyMGQ3rqKpq1gjvxW5U8xdXJK5aQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VxxhV2GdCzl11; Sun, 9 Jun 2024 14:12:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 459ECAhF085780; Sun, 9 Jun 2024 14:12:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 459ECAdG085777; Sun, 9 Jun 2024 14:12:10 GMT (envelope-from git) Date: Sun, 9 Jun 2024 14:12:10 GMT Message-Id: <202406091412.459ECAdG085777@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mark Johnston Subject: git: 54c4a726f56d - stable/14 - acpi: Use device_set_descf() 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: markj X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 54c4a726f56d035c0ba17c14f74da43aaa21d74a Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=54c4a726f56d035c0ba17c14f74da43aaa21d74a commit 54c4a726f56d035c0ba17c14f74da43aaa21d74a Author: Mark Johnston AuthorDate: 2024-02-04 23:51:27 +0000 Commit: Mark Johnston CommitDate: 2024-06-09 13:37:55 +0000 acpi: Use device_set_descf() No functional change intended. MFC after: 1 week (cherry picked from commit bad36a49985c3cd7bfcb1b35ce3ae37f007843ce) --- sys/dev/acpi_support/acpi_asus.c | 22 +++++----------------- sys/dev/acpi_support/acpi_fujitsu.c | 4 +--- sys/dev/acpica/acpi_ec.c | 8 +++----- sys/dev/acpica/acpi_pci_link.c | 9 ++++----- sys/dev/acpica/acpi_timer.c | 4 +--- 5 files changed, 14 insertions(+), 33 deletions(-) diff --git a/sys/dev/acpi_support/acpi_asus.c b/sys/dev/acpi_support/acpi_asus.c index 6e63d8fabab1..b9ba6650d2b7 100644 --- a/sys/dev/acpi_support/acpi_asus.c +++ b/sys/dev/acpi_support/acpi_asus.c @@ -43,7 +43,6 @@ #include #include #include -#include #include #include @@ -535,7 +534,6 @@ acpi_asus_probe(device_t dev) { struct acpi_asus_model *model; struct acpi_asus_softc *sc; - struct sbuf *sb; ACPI_BUFFER Buf; ACPI_OBJECT Arg, *Obj; ACPI_OBJECT_LIST Args; @@ -599,24 +597,17 @@ acpi_asus_probe(device_t dev) } } - sb = sbuf_new_auto(); - if (sb == NULL) - return (ENOMEM); - /* * Asus laptops are simply identified by name, easy! */ for (model = acpi_asus_models; model->name != NULL; model++) { if (strncmp(Obj->String.Pointer, model->name, 3) == 0) { good: - sbuf_printf(sb, "Asus %s Laptop Extras", - Obj->String.Pointer); - sbuf_finish(sb); - sc->model = model; - device_set_desc_copy(dev, sbuf_data(sb)); - sbuf_delete(sb); + device_set_descf(dev, "Asus %s Laptop Extras", + Obj->String.Pointer); + AcpiOsFree(Buf.Pointer); return (rv); } @@ -695,12 +686,9 @@ good: } } - sbuf_printf(sb, "Unsupported Asus laptop: %s\n", Obj->String.Pointer); - sbuf_finish(sb); - - device_printf(dev, "%s", sbuf_data(sb)); + device_printf(dev, "Unsupported Asus laptop: %s\n", + Obj->String.Pointer); - sbuf_delete(sb); AcpiOsFree(Buf.Pointer); return (ENXIO); diff --git a/sys/dev/acpi_support/acpi_fujitsu.c b/sys/dev/acpi_support/acpi_fujitsu.c index 2d3c6f17dfe2..1649f74d873c 100644 --- a/sys/dev/acpi_support/acpi_fujitsu.c +++ b/sys/dev/acpi_support/acpi_fujitsu.c @@ -222,14 +222,12 @@ static int acpi_fujitsu_probe(device_t dev) { char *name; - char buffer[64]; int rv; rv = ACPI_ID_PROBE(device_get_parent(dev), dev, fujitsu_ids, &name); if (acpi_disabled("fujitsu") || rv > 0 || device_get_unit(dev) > 1) return (ENXIO); - sprintf(buffer, "Fujitsu Function Hotkeys %s", name); - device_set_desc_copy(dev, buffer); + device_set_descf(dev, "Fujitsu Function Hotkeys %s", name); return (rv); } diff --git a/sys/dev/acpica/acpi_ec.c b/sys/dev/acpica/acpi_ec.c index d27b7caee9e6..8ee7bc54f304 100644 --- a/sys/dev/acpica/acpi_ec.c +++ b/sys/dev/acpica/acpi_ec.c @@ -339,7 +339,6 @@ acpi_ec_probe(device_t dev) ACPI_OBJECT *obj; ACPI_STATUS status; device_t peer; - char desc[64]; int ecdt; int ret, rc; struct acpi_ec_params *params; @@ -444,10 +443,9 @@ acpi_ec_probe(device_t dev) ret = rc; out: if (ret <= 0) { - snprintf(desc, sizeof(desc), "Embedded Controller: GPE %#x%s%s", - params->gpe_bit, (params->glk) ? ", GLK" : "", - ecdt ? ", ECDT" : ""); - device_set_desc_copy(dev, desc); + device_set_descf(dev, "Embedded Controller: GPE %#x%s%s", + params->gpe_bit, (params->glk) ? ", GLK" : "", + ecdt ? ", ECDT" : ""); } else free(params, M_TEMP); diff --git a/sys/dev/acpica/acpi_pci_link.c b/sys/dev/acpica/acpi_pci_link.c index dac07a07ae7d..d9807876c443 100644 --- a/sys/dev/acpica/acpi_pci_link.c +++ b/sys/dev/acpica/acpi_pci_link.c @@ -143,7 +143,7 @@ acpi_short_name(ACPI_HANDLE handle, char *buffer, size_t buflen) static int acpi_pci_link_probe(device_t dev) { - char descr[28], name[12]; + char name[12]; int rv; /* @@ -157,10 +157,9 @@ acpi_pci_link_probe(device_t dev) return (rv); if (ACPI_SUCCESS(acpi_short_name(acpi_get_handle(dev), name, - sizeof(name)))) { - snprintf(descr, sizeof(descr), "ACPI PCI Link %s", name); - device_set_desc_copy(dev, descr); - } else + sizeof(name)))) + device_set_descf(dev, "ACPI PCI Link %s", name); + else device_set_desc(dev, "ACPI PCI Link"); device_quiet(dev); return (rv); diff --git a/sys/dev/acpica/acpi_timer.c b/sys/dev/acpica/acpi_timer.c index 8b362f52047a..e78b4728749a 100644 --- a/sys/dev/acpica/acpi_timer.c +++ b/sys/dev/acpica/acpi_timer.c @@ -159,7 +159,6 @@ acpi_timer_identify(driver_t *driver, device_t parent) static int acpi_timer_probe(device_t dev) { - char desc[40]; int i, j, rid, rtype; ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); @@ -219,10 +218,9 @@ acpi_timer_probe(device_t dev) } tc_init(&acpi_timer_timecounter); - sprintf(desc, "%d-bit timer at %u.%06uMHz", + device_set_descf(dev, "%d-bit timer at %u.%06uMHz", (AcpiGbl_FADT.Flags & ACPI_FADT_32BIT_TIMER) != 0 ? 32 : 24, acpi_timer_frequency / 1000000, acpi_timer_frequency % 1000000); - device_set_desc_copy(dev, desc); /* Release the resource, we'll allocate it again during attach. */ bus_release_resource(dev, rtype, rid, acpi_timer_reg);