From nobody Sun Jun 09 14:12:04 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 4VxxhN6VmVz5MCKG; Sun, 09 Jun 2024 14:12:04 +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 4VxxhN577vz4Cpr; Sun, 9 Jun 2024 14:12:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717942324; 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=iOpag20XzELTHwLMkl33fJ1awexxdt7QsBq35I76jYs=; b=FSqUNW5c7UMgNr5/omHlwbgJRzIKnsmudxpHIFG8WogLw06DyM3mhNwMOI4Y5nk/6MwKQn 1ndSqBcPgslPVB71RYyxW8U2/uSrymCpqF3KkjYGgI8aobPB0qPEUSFlewZvQoQrRw3B8J fdc7v48VG8CL1Emk+a3vkD3CwqdrXCINpCN9/GljVlwoM1xUEF2RctHkflrw3ofqTyuGg1 CAXjYLtBMAnOM7M/OBEkInfkuodn/jBt7Kw1D4w9Z/YVPYKHDGIiNq/LCcqUOZBTVMaqoo JaJAEXAa2iuv5ZtXmP++PKTrG3idCBLLyxvIp21bhokeh/C+srzuJBPPt/NKiA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717942324; a=rsa-sha256; cv=none; b=cSTXdd1420fgWikmQxPCGJQXqM1lHpfvNYav91qmFcEyvZKd0ra5rs/oRD4s4njS/kJsG0 IwIxClrrXtrbQthj/kj2ylDwVwIk3LatcoPQiLNOn4mTyiN34z7kBz3tpIfkwoGRjImgIc Uu/A9P693FOR3m0FBzTysuNA1/wblyU1hj0Qe0Xs1mis6uRPZfAUmTyOxf1PkXoHjbAegL /FB35PNcOxJNZzeuFH131ccutP52pnbDlYDUC0Z5l/BSm0szfnRQHvXZY2KNN2fFlHBbH2 PgVzGhfJQvRZHolINlZxf8ZbDwDpeqgkcy9HOO821HAvr0ADvocVgKEuhJiIgw== 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=1717942324; 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=iOpag20XzELTHwLMkl33fJ1awexxdt7QsBq35I76jYs=; b=OHU43Fvkx81EMqjyMv/drcO9gBGfWJ/+4bYOM1TtYYcTEe6//eBO9FwJlbFZDVzJcXSJeZ 6pR64dofYf073FOBwEzcMWNgd/iGMyQckw5NK+A7VYoMLJwOiNij9LfHMQiQ0EyCf9Ur9X jZYNQtynAybRSc4HUIOptbCunMYvYHweKtzbEUYvRKACme8k9DrD1kaoeMBJQuGk/JeIlX 3s2TBOAzUldXu68z++W0GaXp3kzKnBWsx4cr3M9txmhH2BkgbNgs4q2B+D/LQ5mLi2xP/f Hs8ZQ+PTxfSILjrIC7GFAS2lhijBYxrhP1/naprVtEymzNqoTplHgZAmvaDgjQ== 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 4VxxhN4lLfzlPJ; Sun, 9 Jun 2024 14:12:04 +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 459EC4kw085595; Sun, 9 Jun 2024 14:12:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 459EC45g085592; Sun, 9 Jun 2024 14:12:04 GMT (envelope-from git) Date: Sun, 9 Jun 2024 14:12:04 GMT Message-Id: <202406091412.459EC45g085592@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: 8cf06a36c535 - stable/14 - cxgb: 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: 8cf06a36c53528a1b1cde955be3bfbd30b1dbe03 Auto-Submitted: auto-generated The branch stable/14 has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=8cf06a36c53528a1b1cde955be3bfbd30b1dbe03 commit 8cf06a36c53528a1b1cde955be3bfbd30b1dbe03 Author: Mark Johnston AuthorDate: 2024-02-04 23:36:54 +0000 Commit: Mark Johnston CommitDate: 2024-06-09 13:37:50 +0000 cxgb: Use device_set_descf() No functional change intended. MFC after: 1 week (cherry picked from commit 796bcf184518ad7ac75b4abfd2bd351ea417fdb6) --- sys/dev/cxgb/cxgb_main.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/sys/dev/cxgb/cxgb_main.c b/sys/dev/cxgb/cxgb_main.c index 1a088cdf0abe..c5fc067f8312 100644 --- a/sys/dev/cxgb/cxgb_main.c +++ b/sys/dev/cxgb/cxgb_main.c @@ -360,7 +360,7 @@ static int cxgb_controller_probe(device_t dev) { const struct adapter_info *ai; - char *ports, buf[80]; + const char *ports; int nports; ai = cxgb_get_adapter_info(dev); @@ -373,8 +373,7 @@ cxgb_controller_probe(device_t dev) else ports = "ports"; - snprintf(buf, sizeof(buf), "%s, %d %s", ai->desc, nports, ports); - device_set_desc_copy(dev, buf); + device_set_descf(dev, "%s, %d %s", ai->desc, nports, ports); return (BUS_PROBE_DEFAULT); } @@ -447,7 +446,6 @@ cxgb_controller_attach(device_t dev) uint32_t vers; int port_qsets = 1; int msi_needed, reg; - char buf[80]; sc = device_get_softc(dev); sc->dev = dev; @@ -659,10 +657,9 @@ cxgb_controller_attach(device_t dev) G_FW_VERSION_MAJOR(vers), G_FW_VERSION_MINOR(vers), G_FW_VERSION_MICRO(vers)); - snprintf(buf, sizeof(buf), "%s %sNIC\t E/C: %s S/N: %s", - ai->desc, is_offload(sc) ? "R" : "", - sc->params.vpd.ec, sc->params.vpd.sn); - device_set_desc_copy(dev, buf); + device_set_descf(dev, "%s %sNIC\t E/C: %s S/N: %s", + ai->desc, is_offload(sc) ? "R" : "", + sc->params.vpd.ec, sc->params.vpd.sn); snprintf(&sc->port_types[0], sizeof(sc->port_types), "%x%x%x%x", sc->params.vpd.port_type[0], sc->params.vpd.port_type[1], @@ -966,13 +963,11 @@ static int cxgb_port_probe(device_t dev) { struct port_info *p; - char buf[80]; const char *desc; p = device_get_softc(dev); desc = p->phy.desc; - snprintf(buf, sizeof(buf), "Port %d %s", p->port_id, desc); - device_set_desc_copy(dev, buf); + device_set_descf(dev, "Port %d %s", p->port_id, desc); return (0); }