From af05948f1a4bafa4c80af26eb11230133d74dece Mon Sep 17 00:00:00 2001 From: Tokunori Ikegami Date: Sun, 24 Mar 2024 22:08:05 +0900 Subject: [PATCH] nvme-print: Use EOM optional data present macros changed Also use the EOM optional data present reserved field macro added. Signed-off-by: Tokunori Ikegami --- nvme-print-json.c | 2 +- nvme-print-stdout.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/nvme-print-json.c b/nvme-print-json.c index 8cf057f2..870c98b4 100644 --- a/nvme-print-json.c +++ b/nvme-print-json.c @@ -2011,7 +2011,7 @@ static void json_phy_rx_eom_descs(struct nvme_phy_rx_eom_log *log, obj_add_uint(jdesc, "ncols", le16_to_cpu(desc->ncols)); obj_add_uint(jdesc, "edlen", le16_to_cpu(desc->edlen)); - if (log->odp & NVME_EOM_PRINTABLE_EYE_PRESENT) + if (NVME_EOM_ODP_PEFP(log->odp)) allocated_eyes[i] = json_eom_printable_eye(desc, r); /* Eye Data field is vendor specific, doesn't map to JSON */ diff --git a/nvme-print-stdout.c b/nvme-print-stdout.c index 1b62a8e4..0b745619 100644 --- a/nvme-print-stdout.c +++ b/nvme-print-stdout.c @@ -707,9 +707,9 @@ static const char *eomip_to_string(__u8 eomip) static void stdout_phy_rx_eom_odp(uint8_t odp) { - __u8 rsvd = (odp >> 2) & 0x3F; - __u8 edfp = (odp >> 1) & 0x1; - __u8 pefp = odp & 0x1; + __u8 rsvd = NVME_EOM_ODP_RSVD(odp); + __u8 edfp = NVME_EOM_ODP_EDFP(odp); + __u8 pefp = NVME_EOM_ODP_PEFP(odp); if (rsvd) printf(" [7:2] : %#x\tReserved\n", rsvd); @@ -751,7 +751,7 @@ static void stdout_phy_rx_eom_descs(struct nvme_phy_rx_eom_log *log) printf("Number of Columns: %u\n", le16_to_cpu(desc->ncols)); printf("Eye Data Length: %u\n", le16_to_cpu(desc->edlen)); - if (log->odp & NVME_EOM_PRINTABLE_EYE_PRESENT) + if (NVME_EOM_ODP_PEFP(log->odp)) stdout_eom_printable_eye(desc); /* Eye Data field is vendor specific */ -- 2.50.1