Skip to content

Commit

Permalink
nvme-print-binary: fix to output phy rx eom log length
Browse files Browse the repository at this point in the history
Previously incorrectly the log length is calculated by the LE log data.
So fix to convert the value from LE to host endian for the calculation.

Signed-off-by: Tokunori Ikegami <[email protected]>
  • Loading branch information
ikegami-t authored and igaw committed Feb 17, 2025
1 parent 3634a93 commit c785a0a
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions nvme-print-binary.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,12 @@ static void binary_boot_part_log(void *bp_log, const char *devname,
d_raw((unsigned char *)bp_log, size);
}

static void binary_phy_rx_eom_log(struct nvme_phy_rx_eom_log *log,
__u16 controller)
static void binary_phy_rx_eom_log(struct nvme_phy_rx_eom_log *log, __u16 controller)
{
size_t len;
size_t len = le16_to_cpu(log->hsize);

if (log->eomip == NVME_PHY_RX_EOM_COMPLETED)
len = log->hsize + log->dsize * log->nd;
else
len = log->hsize;
len += (size_t)le32_to_cpu(log->dsize) * le16_to_cpu(log->nd);

d_raw((unsigned char *)log, len);
}
Expand Down

0 comments on commit c785a0a

Please sign in to comment.