linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: stmmac: use correct pointer when printing normal descriptor ring
@ 2017-05-15  8:56 Niklas Cassel
  2017-05-15 14:02 ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Niklas Cassel @ 2017-05-15  8:56 UTC (permalink / raw)
  To: Giuseppe Cavallaro, Alexandre Torgue; +Cc: Niklas Cassel, netdev, linux-kernel

There are two pointers in sysfs_display_ring,
one that increments if using normal dma descriptors,
another if using extended dma descriptors.

When printing the normal dma descriptors, the wrong pointer is used,
thus the printed descriptor addresses are incorrect.

Signed-off-by: Niklas Cassel <niklas.cassel@axis.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index cd8c60132390..a74c481401c4 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -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++;
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] net: stmmac: use correct pointer when printing normal descriptor ring
  2017-05-15  8:56 [PATCH net-next] net: stmmac: use correct pointer when printing normal descriptor ring Niklas Cassel
@ 2017-05-15 14:02 ` David Miller
  0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2017-05-15 14:02 UTC (permalink / raw)
  To: niklas.cassel
  Cc: peppe.cavallaro, alexandre.torgue, niklass, netdev, linux-kernel

From: Niklas Cassel <niklas.cassel@axis.com>
Date: Mon, 15 May 2017 10:56:06 +0200

> There are two pointers in sysfs_display_ring,
> one that increments if using normal dma descriptors,
> another if using extended dma descriptors.
> 
> When printing the normal dma descriptors, the wrong pointer is used,
> thus the printed descriptor addresses are incorrect.
> 
> Signed-off-by: Niklas Cassel <niklas.cassel@axis.com>

Applied, thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next] net: stmmac: use correct pointer when printing normal descriptor ring
  2017-05-09 16:52 Niklas Cassel
@ 2017-05-27 21:59 ` Andy Shevchenko
  0 siblings, 0 replies; 4+ messages in thread
From: Andy Shevchenko @ 2017-05-27 21:59 UTC (permalink / raw)
  To: Niklas Cassel
  Cc: Giuseppe Cavallaro, Alexandre Torgue, Niklas Cassel, netdev,
	linux-kernel

On Tue, May 9, 2017 at 7:52 PM, Niklas Cassel <niklas.cassel@axis.com> wrote:
> From: Niklas Cassel <niklas.cassel@axis.com>

Commit message?

>                         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),

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

>                                    le32_to_cpu(p->des0), le32_to_cpu(p->des1),
>                                    le32_to_cpu(p->des2), le32_to_cpu(p->des3));
>                         p++;

-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH net-next] net: stmmac: use correct pointer when printing normal descriptor ring
@ 2017-05-09 16:52 Niklas Cassel
  2017-05-27 21:59 ` Andy Shevchenko
  0 siblings, 1 reply; 4+ messages in thread
From: Niklas Cassel @ 2017-05-09 16:52 UTC (permalink / raw)
  To: Giuseppe Cavallaro, Alexandre Torgue; +Cc: Niklas Cassel, netdev, linux-kernel

From: Niklas Cassel <niklas.cassel@axis.com>

Signed-off-by: Niklas Cassel <niklas.cassel@axis.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index cd8c60132390..a74c481401c4 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -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++;
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-05-27 21:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-15  8:56 [PATCH net-next] net: stmmac: use correct pointer when printing normal descriptor ring Niklas Cassel
2017-05-15 14:02 ` David Miller
  -- strict thread matches above, loose matches on Subject: below --
2017-05-09 16:52 Niklas Cassel
2017-05-27 21:59 ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).