From nobody Tue Nov 15 07:26:05 2022 X-Original-To: dev-commits-src-main@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 4NBHlx6vhMz4hBW9; Tue, 15 Nov 2022 07:26: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 4NBHlx6PRzz3h2x; Tue, 15 Nov 2022 07:26:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1668497165; 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=4EQgroMj8m0My2Q19bla/3McLoYHYLyd8ZsqiCvqog0=; b=IH4xSyraxsv3hwNuwn1v8EDzCQCJ8xl6IntIRBmLo0u4eiLlXLkj7loVqx4sLjkxQwk0lz a+BOtky6NfRCYPDA6oIQsIoj+08+F8R00xcjxpwWEH1UaWvjvwjleIA32DwJsSoQfL9pvW 3GG1O4kmmPJhb+aObtr3mUyeDJIC7rze2bIiD/3Uw9HDmGVMy+3zMUxP+tXNQskj9DQK0P b0XprWhj/wz0yOt7nGH6HIw4g4q4HdH4JRwk3gxvbXnOvyJlZ2F1I4qcBSJav5og/S+Ebs UTianYoDsuv+yiz2Ro9OgTQ+LzgwgnMEZpuixOUAKYD1J7mPG5Qdt/yU62lnvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1668497165; 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=4EQgroMj8m0My2Q19bla/3McLoYHYLyd8ZsqiCvqog0=; b=iFroY79UvnIn/6alPtzgYAqS6x640zY4XccOyc033/k38wVsKcbZcNDkGGejjG9jUkYSuu B+XvuKVpQ00vk+/0HxoRfdzGJwMnXKZSqe5M+qQR1tNArTaZG/+dYZEME3dJeQ4YISfSIg qopgtblBncN6N7czQBEiERr9P/pIP9vbBFXiHpOCoBbegvkwNhneHkFhUEkQEI+BsdtaQO wBa1LjYx8U46GNMtkSGzaV7uHhZUxLLolmbLpdDcp9w2UG7S8ZSozkPDa19JcyiQ0+lnT8 hHLepoV5wPfWBca/rV7a7GBzySzTXHNwVTE37SV+XQwUO5D5vz1fAiN/rLs+KQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1668497165; a=rsa-sha256; cv=none; b=NQtGbcl5ESmUzexrS28zy5++LjNblaZautHOSRFxRHWvtFVZHUkXQfjUHAeMSsPbs7K2PD IVfu1LhRe0xDnN3YwKQbY1Ow7sNawDo515/wcZlD/DFu/waf+WH/6LCIZCdB/rkQyTU+4Y bbkh3y3GWNtH/5kP6wGKCRsbSC0jV/KLYEdqPwj2b8yYSDStRc3kLZsK5n1hlW9m+QoXs0 526cZ0+DzmZlDYpl/NyLG36hiCExNQIxoWJA6c071cThnXPE/n76JkyJXDtmvp9codTQk8 eS1kwZ9kW+9fTFEt+D+B1D9aVTPD9wI5C0TpOm7OEjV+VnlLc0r+6rjNeqhJBw== 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 4NBHlx5SpSz1CwJ; Tue, 15 Nov 2022 07:26: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 2AF7Q5o4046062; Tue, 15 Nov 2022 07:26:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2AF7Q5qK046061; Tue, 15 Nov 2022 07:26:05 GMT (envelope-from git) Date: Tue, 15 Nov 2022 07:26:05 GMT Message-Id: <202211150726.2AF7Q5qK046061@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Corvin=20K=C3=B6hne?= Subject: git: 0fd43b0c6a76 - main - nvmecontrol: Fix condition when print number of Firmware Slots and Firmware Slot1 Readonly. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 0fd43b0c6a76d7be4d9673837a7d7099b6a29ace Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by corvink: URL: https://cgit.FreeBSD.org/src/commit/?id=0fd43b0c6a76d7be4d9673837a7d7099b6a29ace commit 0fd43b0c6a76d7be4d9673837a7d7099b6a29ace Author: Wanpeng Qian AuthorDate: 2022-11-14 12:59:11 +0000 Commit: Corvin Köhne CommitDate: 2022-11-15 06:48:20 +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 --- 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 50b8901b799e..1e35ae855e3e 100644 --- a/sbin/nvmecontrol/identify_ext.c +++ b/sbin/nvmecontrol/identify_ext.c @@ -204,16 +204,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);