diff options
author | Wanpeng Qian <wanpengqian@gmail.com> | 2022-11-14 12:59:11 +0000 |
---|---|---|
committer | Corvin Köhne <corvink@FreeBSD.org> | 2022-11-22 06:51:48 +0000 |
commit | 94fe3a527eb2f0f02ad40c1c9464a454344ae4d5 (patch) | |
tree | 1f38b24776829c50e3cddeb7610309542da751d9 /sbin | |
parent | 5ebc003a2882a35054a93411a2c4d60f6e9cec3c (diff) | |
download | src-94fe3a527eb2f0f02ad40c1c9464a454344ae4d5.tar.gz src-94fe3a527eb2f0f02ad40c1c9464a454344ae4d5.zip |
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)
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/nvmecontrol/identify_ext.c | 12 |
1 files 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); |