From nobody Tue Jul 26 19:33:27 2022 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 4LsnBw26CCz4Wx8Y; Tue, 26 Jul 2022 19:33:28 +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 4LsnBv4RRqz47XF; Tue, 26 Jul 2022 19:33:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658864007; 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=YqLiq7yWcIu+s1hrDtxZjN8hNZv+L5Qo9DDPw/Z0ocI=; b=CtObC83E2NHqgOLvDTNLzONdZoc26MZDNhEEfEqMB004J53YsMzNlflzyJLs/uqzNnxBno suwuxh5VWyncF/+JH6N5JgP45NAcTG+m5N/g0hqAmw6w+KLzQs9uX57OIqgFqpcIqMTfnL S3d0e1MP5pRQyn4rvaBPpvxocfcmARzvGZRGKpcfBvu5ULLDoyl0lipnV30vmV4QU3JCq+ hb0D9KbgG+f8yqCP5rNR8Xjf+T0s68XNPN1BqPKfumjsPMdvtxdd/OhV37u0mYtuTBNGTU 7VsI3jvT+eiPef3r53QK4o9PtaWGM9o0UV6M9TrYxtwB6Ke91h3WgqivcH7piA== 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 4LsnBv37Lqzph1; Tue, 26 Jul 2022 19:33:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 26QJXR45033875; Tue, 26 Jul 2022 19:33:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26QJXRiA033874; Tue, 26 Jul 2022 19:33:27 GMT (envelope-from git) Date: Tue, 26 Jul 2022 19:33:27 GMT Message-Id: <202207261933.26QJXRiA033874@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Marcin Wojtas Subject: git: c093a162a2ac - stable/12 - ena: Use device_set_desc in probe 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mw X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: c093a162a2acf70c7ac909a9d9193255fbf2a5f6 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658864007; 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=YqLiq7yWcIu+s1hrDtxZjN8hNZv+L5Qo9DDPw/Z0ocI=; b=RDrzg79KLA/te4xowjOVm7+K82upfYiYKqfDGSytPs9/tjOgJXPFL+yK+/h57S+AnkIL2L XdiB3WOHkvEoZABtnxT5ivBfkYW5RFsx6M7okSkebysFTSm153mxRh8NbasfDig6WJPzaA 8i/7zAv+h8X+fz57Ep+mO1Zsdz1cwBVn/aoENRATE9ET5r+nD7CnQWNUroKO+M/SiF89qg SYNWG7iWND2r4+ybzFnzyRI/pCnm8Ag+jVpjWEDywzYZoLC3VSpotWLSfYfpDPZENcIVVg YRXZ21iNMF+t60TCwe1OonA15jFTTkht9KnNJAgm/CEl33gv5+xMQ57EJqt7GQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1658864007; a=rsa-sha256; cv=none; b=Gbyr3Bnz/YLm49PSvfAbSnRm6uHn/tH0hqK1MB/bS3kdV4M5MWX48m1yuLP9H3sh9w+1tE r9ylTqbVx6sAlnHwJ9etGQ2UOoqJZN4y4R7KalrJRTkN1eskRKJPBuDaygCQVTTyJwgnly btCg7b0RJ4y9fQ+rSB+aNU75wtQn9fRfQ3VJs3wO3fW69goU8REJIeuPT9D7OJSYiU8CEq TOAFmbuCyL9N5uXmD6UkXd8RzhTynzvptnWA3gwFAYlNmt8ghWRxRzOsWCXQ0xZieNdWyN CMDKt8+ZT02tsYmf3hiGnRZijg1vIDFafpa916HFzS26x3SfTL1qGtHYayI4WA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by mw: URL: https://cgit.FreeBSD.org/src/commit/?id=c093a162a2acf70c7ac909a9d9193255fbf2a5f6 commit c093a162a2acf70c7ac909a9d9193255fbf2a5f6 Author: Dawid Gorecki AuthorDate: 2022-06-10 09:18:10 +0000 Commit: Marcin Wojtas CommitDate: 2022-07-26 19:33:04 +0000 ena: Use device_set_desc in probe During probe the driver created a temporary buffer to which the value of DEVICE_DESC constant was printed. This buffer was then copied to the device structure using device_set_desc_copy. Since the value of this string is exactly the same for every device using the ENA driver, using sprintf is unnecessary, and device_set_desc can be used instead. Obtained from: Semihalf MFC after: 2 weeks Sponsored by: Amazon, Inc. (cherry picked from commit 755e60ca046390bdcfc097b6a8f1a032d47a7b65) --- sys/dev/ena/ena.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sys/dev/ena/ena.c b/sys/dev/ena/ena.c index b28156ef2ab2..3a5e8c28686a 100644 --- a/sys/dev/ena/ena.c +++ b/sys/dev/ena/ena.c @@ -296,7 +296,6 @@ static int ena_probe(device_t dev) { ena_vendor_info_t *ent; - char adapter_name[60]; uint16_t pci_vendor_id = 0; uint16_t pci_device_id = 0; @@ -310,8 +309,7 @@ ena_probe(device_t dev) ena_log_raw(DBG, "vendor=%x device=%x\n", pci_vendor_id, pci_device_id); - sprintf(adapter_name, DEVICE_DESC); - device_set_desc_copy(dev, adapter_name); + device_set_desc(dev, DEVICE_DESC); return (BUS_PROBE_DEFAULT); }