From nobody Sun Jun 02 23:47:25 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 4VstnV1DsKz5LVpd; Sun, 02 Jun 2024 23:47:26 +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 4VstnT5qysz4BNR; Sun, 2 Jun 2024 23:47:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717372045; 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=3sO0a23fM9usdM0irrs8YN8R7oBgRMElovGf2+ycnRA=; b=ONltVaXDQhV46/RbB++3d4mkZdGyk8H6qKc6yQAs0zUpaBg5mDuE74K9dh7axTQK/CbT1T wICIxJoC4ItzO++YIvoqu6YObmB2NLl20MAmBSa+fLg70JmNS9Fk7jGnkZxkhrkecARTeh mPCGsogpUmM1et0zB62DIPSKrIkBo3tClE9p9CmP1KO+dmyVtwtuwMFr1M+NJQU2lEbp6h vKOqUqTJDsJt95dI/UyvYIml6NDDAM1np1oh/cy+vihlVC6VB9evbzIkaAASEP+bmYAc63 wb/Z0hFGyhCiRO/DuDXP3za1tOxXxiUOpLaaOYjBRc9bzgQJfgYP8HKTg7ZX5A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717372045; a=rsa-sha256; cv=none; b=XfguSyVFX91E6BeyeJj76FxB9TtJ03YDREM0l9CsnrOEqeIew8vTK5TIe3iIQ2ts8mjjE1 /0Luo+xVzw5tBkG26D39biZFJlarwjAZSK0FqCpyVPR7R6z5G9z8gEIvEzGcdu5hU+ZxSD d7gFrpzQCwwGHHM0GdjRolmw8WQIk+d2bZwUGVJpSG5e3N57ucDgOXkT2xMT+8Vbg9MI1q f7sPXeFwfl5ZVvaGCZ5lPxRHK5FS2mc3bFGnbJqtOpoKZUa+DuH8cjQmooWEw8ViCJ7su3 e220eB5EbhZfl/PAX1V60M+KPVSsEcbQReh/UwIpUad4JHUntHOfSXYAm5cvoA== 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=1717372045; 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=3sO0a23fM9usdM0irrs8YN8R7oBgRMElovGf2+ycnRA=; b=ogVEVp6KXHANaqI4A5TsoqH+s1m++9hawDcQj6uNXpCrIa13rdEv5hry5zkJo8Xb8tLNzT p9TbZubJufrkLSmfG+4gmvEEtlUqYfkksDguXr9Y776RCXCeMr8dInU5ahPMjtxB2ErCtJ ff6rI/rvQ7DDIGnz75a5NRwVRio2iPUmv+RXeXxOYZYw4jKSQsLhO93e0qSuTsWB2OLCs+ SlozD3wrq6/Z3VK4WddOxZzZT02WY90fG6To8FpqcnVPFtBRx0t/roDwgx0pf02fqEIeIw HF6T9sBRPy5pUbwQEcXmzEv3JtXtRtO7PgkGWxdkLPkn9DA8NV+M/Rz9fhI+QQ== 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 4VstnT5PDVz1B4x; Sun, 2 Jun 2024 23:47:25 +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 452NlP2T056887; Sun, 2 Jun 2024 23:47:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 452NlPgO056884; Sun, 2 Jun 2024 23:47:25 GMT (envelope-from git) Date: Sun, 2 Jun 2024 23:47:25 GMT Message-Id: <202406022347.452NlPgO056884@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 542f9494b747 - main - proto: 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/main X-Git-Reftype: branch X-Git-Commit: 542f9494b747079b13f3ed672cd01fa902e98ff2 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=542f9494b747079b13f3ed672cd01fa902e98ff2 commit 542f9494b747079b13f3ed672cd01fa902e98ff2 Author: Mark Johnston AuthorDate: 2024-02-04 23:58:30 +0000 Commit: Mark Johnston CommitDate: 2024-06-02 23:38:41 +0000 proto: Use device_set_descf() No functional change intended. MFC after: 1 week --- sys/dev/proto/proto_bus_isa.c | 8 +------- sys/dev/proto/proto_bus_pci.c | 12 +++--------- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/sys/dev/proto/proto_bus_isa.c b/sys/dev/proto/proto_bus_isa.c index 0e4f2a29b429..39ad126bf7b7 100644 --- a/sys/dev/proto/proto_bus_isa.c +++ b/sys/dev/proto/proto_bus_isa.c @@ -32,7 +32,6 @@ #include #include #include -#include #include #include @@ -62,7 +61,6 @@ static char **proto_isa_devnames; static int proto_isa_probe(device_t dev) { - struct sbuf *sb; struct resource *res; int rid, type; @@ -76,11 +74,7 @@ proto_isa_probe(device_t dev) if (res == NULL) return (ENODEV); - sb = sbuf_new_auto(); - sbuf_printf(sb, "%s:%#jx", proto_isa_prefix, rman_get_start(res)); - sbuf_finish(sb); - device_set_desc_copy(dev, sbuf_data(sb)); - sbuf_delete(sb); + device_set_descf(dev, "%s:%#jx", proto_isa_prefix, rman_get_start(res)); bus_release_resource(dev, type, rid, res); return (proto_probe(dev, proto_isa_prefix, &proto_isa_devnames)); } diff --git a/sys/dev/proto/proto_bus_pci.c b/sys/dev/proto/proto_bus_pci.c index 9a98443845f5..ebcfd6d4711c 100644 --- a/sys/dev/proto/proto_bus_pci.c +++ b/sys/dev/proto/proto_bus_pci.c @@ -32,7 +32,6 @@ #include #include #include -#include #include #include @@ -62,17 +61,12 @@ static char **proto_pci_devnames; static int proto_pci_probe(device_t dev) { - struct sbuf *sb; - if ((pci_read_config(dev, PCIR_HDRTYPE, 1) & PCIM_HDRTYPE) != 0) return (ENXIO); - sb = sbuf_new_auto(); - sbuf_printf(sb, "%s%d:%d:%d:%d", proto_pci_prefix, pci_get_domain(dev), - pci_get_bus(dev), pci_get_slot(dev), pci_get_function(dev)); - sbuf_finish(sb); - device_set_desc_copy(dev, sbuf_data(sb)); - sbuf_delete(sb); + device_set_descf(dev, "%s%d:%d:%d:%d", proto_pci_prefix, + pci_get_domain(dev), pci_get_bus(dev), pci_get_slot(dev), + pci_get_function(dev)); return (proto_probe(dev, proto_pci_prefix, &proto_pci_devnames)); }