Skip to contentSkip to conversation

net: stmmac: use correct pointer when printing normal descriptor ring

PATCH In review Niklas Cassel 2 participants 2 messages May 9, 2017 – May 27, 2017

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: stmmac: use correct pointer when printing normal descriptor ring

From: Niklas Cassel <[email protected]>

---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +1 -1
index cd8c60132390..a74c481401c4 100644
@@ -3725,7 +3725,7 @@ static void sysfs_display_ring(void *head, int size, int extend_desc,
 			ep++;
 		} else {
 			seq_printf(seq, "%d [0x%x]: 0x%x 0x%x 0x%x 0x%x\n",
-				   i, (unsigned int)virt_to_phys(ep),
+				   i, (unsigned int)virt_to_phys(p),
 				   le32_to_cpu(p->des0), le32_to_cpu(p->des1),
 				   le32_to_cpu(p->des2), le32_to_cpu(p->des3));
 			p++;
Signature · 1 line
2.11.0
#1 lore raw
Quoted 1 line · Niklas Cassel

From: Niklas Cassel <[email protected]>

Commit message?

drivers/net/ethernet/stmicro/stmmac/stmmac_main.c static void sysfs_display_ring(void *head, int size, int extend_desc, · line 3728

Quoted 3 lines
                        seq_printf(seq, "%d [0x%x]: 0x%x 0x%x 0x%x 0x%x\n",
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +1 -1
-                                  i, (unsigned int)virt_to_phys(ep),
+                                  i, (unsigned int)virt_to_phys(p),

There is should not be casting. Pointer might be 64-bit, thus %pap must be used instead with a reference to the physical address.

Quoted 3 lines
                                   le32_to_cpu(p->des0), le32_to_cpu(p->des1),
                                   le32_to_cpu(p->des2), le32_to_cpu(p->des3));
                        p++;
Signature · 2 lines
With Best Regards,
Andy Shevchenko