diff mbox

[05/10] phb4: Fix endian of TLP headers print

Message ID 20170720062220.14667-5-mikey@neuling.org
State Accepted
Headers show

Commit Message

Michael Neuling July 20, 2017, 6:22 a.m. UTC
Byte swap TLP headers so they are the same as the PCIe spec.

Also remove redundant print.

Suggested-by: Rob Lippert <rlippert@google.com>
Signed-off-by: Michael Neuling <mikey@neuling.org>
---
 hw/phb4.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
diff mbox

Patch

diff --git a/hw/phb4.c b/hw/phb4.c
index cf9ee61871..6c3ca60ae2 100644
--- a/hw/phb4.c
+++ b/hw/phb4.c
@@ -203,12 +203,12 @@  static void phb4_eeh_dump_regs(struct phb4 *p)
 	PHBERR(p, "       uncorrErrorStatus = %08x\n", s->uncorrErrorStatus);
 	PHBERR(p, "         corrErrorStatus = %08x\n", s->corrErrorStatus);
 	PHBERR(p, "       uncorrErrorStatus = %08x\n", s->uncorrErrorStatus);
-	PHBERR(p, "                 tlpHdr1 = %08x\n", s->tlpHdr1);
-	PHBERR(p, "                 tlpHdr2 = %08x\n", s->tlpHdr2);
-	PHBERR(p, "                 tlpHdr3 = %08x\n", s->tlpHdr3);
-	PHBERR(p, "                 tlpHdr4 = %08x\n", s->tlpHdr4);
+	/* Byte swap TLP headers so they are the same as the PCIe spec */
+	PHBERR(p, "                 tlpHdr1 = %08x\n", bswap_32(s->tlpHdr1));
+	PHBERR(p, "                 tlpHdr2 = %08x\n", bswap_32(s->tlpHdr2));
+	PHBERR(p, "                 tlpHdr3 = %08x\n", bswap_32(s->tlpHdr3));
+	PHBERR(p, "                 tlpHdr4 = %08x\n", bswap_32(s->tlpHdr4));
 	PHBERR(p, "                sourceId = %08x\n", s->sourceId);
-	PHBERR(p, "                 tlpHdr1 = %08x\n", s->tlpHdr1);
 	PHBERR(p, "                    nFir = %016llx\n", s->nFir);
 	PHBERR(p, "                nFirMask = %016llx\n", s->nFirMask);
 	PHBERR(p, "                 nFirWOF = %016llx\n", s->nFirWOF);