Skip to content

Commit aac3e51

Browse files
ikegami-tigaw
authored andcommitted
nvme-print-stdout: Use NVME_BOOT_PARTITION_INFO field definitions
Change it instead of hardcoded field mask and shift values. Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
1 parent cbe5bec commit aac3e51

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

nvme-print-stdout.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -675,13 +675,13 @@ static void stdout_mi_cmd_support_effects_log(struct nvme_mi_cmd_supported_effec
675675
static void stdout_boot_part_log(void *bp_log, const char *devname,
676676
__u32 size)
677677
{
678-
struct nvme_boot_partition *hdr;
678+
struct nvme_boot_partition *hdr = bp_log;
679679

680-
hdr = bp_log;
681680
printf("Boot Partition Log for device: %s\n", devname);
682681
printf("Log ID: %u\n", hdr->lid);
683-
printf("Boot Partition Size: %u KiB\n", le32_to_cpu(hdr->bpinfo) & 0x7fff);
684-
printf("Active BPID: %u\n", (le32_to_cpu(hdr->bpinfo) >> 31) & 0x1);
682+
printf("Boot Partition Size: %u KiB\n",
683+
NVME_BOOT_PARTITION_INFO_BPSZ(le32_to_cpu(hdr->bpinfo)));
684+
printf("Active BPID: %u\n", NVME_BOOT_PARTITION_INFO_ABPID(le32_to_cpu(hdr->bpinfo)));
685685
}
686686

687687
static const char *eomip_to_string(__u8 eomip)

0 commit comments

Comments
 (0)