From nobody Wed Nov 23 09:44:05 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 4NHGRT3W8sz4jCwG; Wed, 23 Nov 2022 09:44:05 +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 4NHGRT2x8Hz4Fq8; Wed, 23 Nov 2022 09:44:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1669196645; 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=BabjhElcoHZTOWKC+ff+tiKe2MMpKOyGlcSf9qIg338=; b=YmUsmjXDxWvs974Jzt1rZBxWigD17NLuPy300IgJKyLCXVDowkfwq/RmN1B7CHdwjLXrpx y3NpizBl/YKVOfdanbDida0zKKCBzkhMNlG50o6EIX6VOaGE8qwRVOH7mdi4Vi4YvJLvCX Yf65JOUlS/nZJTFNLLSbj4caj8pm0ei8lDU2kWI5LbgyUFaPMKX/X/GCGm90O6Sj/GVF2n tOs6FBiwOA2kEVQYf/7PcTI17fFuaDU4XEsmkTVA09rpbKt/scPtoZHudwKtPydrONUIax 5TIQck96KXpidacj7YHkINh6VYtcwkcO8SNn0KEAvNnR/mEQrUZ378jepRUuFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1669196645; 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=BabjhElcoHZTOWKC+ff+tiKe2MMpKOyGlcSf9qIg338=; b=rQ3lGgsXVvg8juzCpAlsvJ1CtCpSDbhDdflbijxFq9sAknOPqj/6sebcxJ05SXjUjvkN8e UEVlMXCkBYMrCihTm4WKID0m2zC8zXA9Yh8UBw19KHueABeqpN/NjZ0l93WIo359TC9+5E 5DCEGAa7wjKTMy76V2CFylIHmQW+YNpa3nl01tK7OxnPEiQmAPvs23TYsLhiC2WRZR3Kn2 VHmmQGHkK+9KHsklsYqAgb/MaIZEHNtaFmmqar6FDRM7ZhWaXC/MLm06nxOdoo39R9GRwB qvJQ3pO1/+KrpqkgJXOqcyuz4t9yFfUmM+BzeQyhCLCzIcJ18Vfw0JCkG0Pxsg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1669196645; a=rsa-sha256; cv=none; b=edRpNzPk/+6j/am041anIb/7xgIBo4M0WdDORX4M382545tSiL6u4VYeKFBqVL0TS3tGs7 j5f31hX7GxLQyw0jhPoGbMVEFVn2hoXQYMBNEjUVvsanS4M5DdTbIMDBHCXRXe5MYS2fNA MuaqPMaoopMBfju5PQYe42okxHvCOYUQBp5z3N/nP67kVM2XHh9DpyogzknvD9bB+bomfb 5QjQsoi87CBCMOQ+JRp9zG7zBySSH+TjxdX4N1uErNwxE2a9RTj5FMDQMoqroj95ukhnye P2S9TdkYgx4BDUMyA6IFlXNeGGz5I+g7mSjUz/U35fpjmKAbzkBzvlH790alwQ== 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 4NHGRT233szHr6; Wed, 23 Nov 2022 09:44:05 +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 2AN9i5ef015798; Wed, 23 Nov 2022 09:44:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2AN9i5ue015797; Wed, 23 Nov 2022 09:44:05 GMT (envelope-from git) Date: Wed, 23 Nov 2022 09:44:05 GMT Message-Id: <202211230944.2AN9i5ue015797@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: =?utf-8?Q?Corvin=20K=C3=B6hne?= Subject: git: 94fe3a527eb2 - stable/13 - nvmecontrol: Fix condition when print number of Firmware Slots and Firmware Slot1 Readonly. 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: corvink X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 94fe3a527eb2f0f02ad40c1c9464a454344ae4d5 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by corvink: URL: https://cgit.FreeBSD.org/src/commit/?id=94fe3a527eb2f0f02ad40c1c9464a454344ae4d5 commit 94fe3a527eb2f0f02ad40c1c9464a454344ae4d5 Author: Wanpeng Qian AuthorDate: 2022-11-14 12:59:11 +0000 Commit: Corvin Köhne CommitDate: 2022-11-22 06:51:48 +0000 nvmecontrol: Fix condition when print number of Firmware Slots and Firmware Slot1 Readonly. The Number of Firmware Slots should never be zero. So, a Firmware Slot 1 should always exist. For that reason, always print the Number of Firmware Slots and the Firmware Slot 1 Read-Only value. Reviewed by: imp Approved by: manu (mentor) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D34700 (cherry picked from commit 0fd43b0c6a76d7be4d9673837a7d7099b6a29ace) --- sbin/nvmecontrol/identify_ext.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/sbin/nvmecontrol/identify_ext.c b/sbin/nvmecontrol/identify_ext.c index 311c8cba09a9..272946d319d4 100644 --- a/sbin/nvmecontrol/identify_ext.c +++ b/sbin/nvmecontrol/identify_ext.c @@ -172,16 +172,8 @@ nvme_print_controller(struct nvme_controller_data *cdata) } printf("Abort Command Limit: %d\n", cdata->acl+1); printf("Async Event Request Limit: %d\n", cdata->aerl+1); - printf("Number of Firmware Slots: "); - if (fw != 0) - printf("%d\n", fw_num_slots); - else - printf("N/A\n"); - printf("Firmware Slot 1 Read-Only: "); - if (fw != 0) - printf("%s\n", fw_slot1_ro ? "Yes" : "No"); - else - printf("N/A\n"); + printf("Number of Firmware Slots: %d\n", fw_num_slots); + printf("Firmware Slot 1 Read-Only: %s\n", fw_slot1_ro ? "Yes" : "No"); printf("Per-Namespace SMART Log: %s\n", ns_smart ? "Yes" : "No"); printf("Error Log Page Entries: %d\n", cdata->elpe+1);