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
This commit is contained in:
Wanpeng Qian 2022-11-14 13:59:11 +01:00 committed by Corvin Köhne
parent 40e0fa10f5
commit 0fd43b0c6a
No known key found for this signature in database
GPG key ID: D854DA56315E026A

View file

@ -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);