git: 0fd43b0c6a76 - main - nvmecontrol: Fix condition when print number of Firmware Slots and Firmware Slot1 Readonly.
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 15 Nov 2022 07:26:05 UTC
The branch main has been updated by corvink: URL: https://cgit.FreeBSD.org/src/commit/?id=0fd43b0c6a76d7be4d9673837a7d7099b6a29ace commit 0fd43b0c6a76d7be4d9673837a7d7099b6a29ace Author: Wanpeng Qian <wanpengqian@gmail.com> AuthorDate: 2022-11-14 12:59:11 +0000 Commit: Corvin Köhne <corvink@FreeBSD.org> 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);