From nobody Tue Jul 26 19:30:56 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 4Lsn8113zZz4WwFm; Tue, 26 Jul 2022 19:30:57 +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 4Lsn804RCXz42wb; Tue, 26 Jul 2022 19:30:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658863856; 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=NsiiLpDxL5aDkrBWxPrsDtjvc7WLJxKG97jU1WrMkgk=; b=xXxEJRaOA8Pai7cQsJ6XrKy+fk8qgtV61YkIh8AHp5CQxbF/Dyq0vMBsgyLX5cR0bAlBnM 4gBl5a+M9XYUdiCxUriHKd0bhSFTmBoJXBbYMwaaUQpA9s3gi7l7e3osKYYg/ENfs8rKd3 fQWPtTPSU9ShgJiJfF2llUJd6evU7NeNZGa5yxx7+vXaUfZxU8TMJ15lBXVHy56c/bPOOM i907jxQSJF1SnRgm99kR5FdssimkQhIWE+uebXze/HSOUUBxfeJm49ScH0L48OoVJh1KW7 r0l0zBIDdNueflD+rYgqL1jgAqxCuF4vP8VDQPJykUW0dt8qdUKY+z/aIglQXQ== 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 4Lsn803XGxzpMZ; Tue, 26 Jul 2022 19:30:56 +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 26QJUuZw029710; Tue, 26 Jul 2022 19:30:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26QJUu3Y029709; Tue, 26 Jul 2022 19:30:56 GMT (envelope-from git) Date: Tue, 26 Jul 2022 19:30:56 GMT Message-Id: <202207261930.26QJUu3Y029709@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: 5d747111151d - stable/13 - 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/13 X-Git-Reftype: branch X-Git-Commit: 5d747111151d88e7b1275616390bb84005277dc3 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658863856; 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=NsiiLpDxL5aDkrBWxPrsDtjvc7WLJxKG97jU1WrMkgk=; b=BTD89uyxlwr4+EDHs73Nvd4TrDeGXJzR1HSJ02Gqp8YNUhq/jDCEmWDy1UG0kv2dOatRdP v7ly4o/VZyZipJN0hR0bN4q/mSTudAa2QPSBQAP2lvcZ9qzf3Bzva59ShbE/2x0TReZ6Dk Tb7yg9HY7jeW/d1xqaIlQakCPNxuPg3d2tNeR5lJ35yBOGeYTQWgrOHve8t+PrfOIrfWY8 Azp0YZwHAEk10Pr2GZhvJY4Ea3feH1EhtpjkZ5DbkK6tNBRQHuteJ0POhHwoDHwMe9OixE 9M4wtyI8bku5X3E1EH3ykUiUyBDYSoJG624weHx/mmYQStSZnbzr1YcR1cC3YA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1658863856; a=rsa-sha256; cv=none; b=aQt+FRBvS3Dld45+fiDS9tSlyNxwbHL2jLp4NSy08+uoMsJvKhNNEbxBuC1p/EpooUzass gyxG52O4EMbRQl8o65oUTls+dwAWEDqQykyKB6QDh1SMuDe/Wz0feTP4BgyB3CFCm/YrZ5 ISMyAeN4cv7F1tgxIaTptbqrvDFo6LA3ChjToJyhBdCTSe+Wer079hHT5N84rKIW697Fuw WJTz25E3EIhlufJ+SPswYNa6tW3pfK9ZIU1NwpJkIW/2MWs51LsL1bXBARo+eSms9CbEuJ nwVhTpyYlKOkAx0e94K9Z68spzumzAid070pQ8JRrqI9iDJlx3nHrGBGhshzBw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mw: URL: https://cgit.FreeBSD.org/src/commit/?id=5d747111151d88e7b1275616390bb84005277dc3 commit 5d747111151d88e7b1275616390bb84005277dc3 Author: Dawid Gorecki AuthorDate: 2022-06-10 09:18:10 +0000 Commit: Marcin Wojtas CommitDate: 2022-07-26 19:30:15 +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 6a3956ddd181..dc8acb80c5e6 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); }