diff mbox series

[RFC,net-next] net: ethernet: mtk_eth_soc: don't convert byte order of etype

Message ID 20230525-mtk_eth_soc-etype-endianness-v1-1-b5da9258ed86@kernel.org (mailing list archive)
State New, archived
Headers show
Series [RFC,net-next] net: ethernet: mtk_eth_soc: don't convert byte order of etype | expand

Commit Message

Simon Horman May 25, 2023, 2:19 p.m. UTC
*** This will change the value exposed by debugfs. ***
*** I am unsure if that counts as UABI breakage.   ***
*** If so, this patch should be rejected.          ***

The type of the etype field of struct mtk_foe_mac_info is u16.
And it is always used to store values on host byte order.
So there is no need to convert it from network to host byte order
when formatting in a string.

Flagged by sparse:
  .../mtk_ppe_debugfs.c:161:46: warning: cast to restricted __be16

Compile tested only.

Signed-off-by: Simon Horman <horms@kernel.org>
---
 drivers/net/ethernet/mediatek/mtk_ppe_debugfs.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/drivers/net/ethernet/mediatek/mtk_ppe_debugfs.c b/drivers/net/ethernet/mediatek/mtk_ppe_debugfs.c
index 316fe2e70fea..7e4213241cc1 100644
--- a/drivers/net/ethernet/mediatek/mtk_ppe_debugfs.c
+++ b/drivers/net/ethernet/mediatek/mtk_ppe_debugfs.c
@@ -158,9 +158,9 @@  mtk_ppe_debugfs_foe_show(struct seq_file *m, void *private, bool bind)
 		seq_printf(m, " eth=%pM->%pM etype=%04x"
 			      " vlan=%d,%d ib1=%08x ib2=%08x"
 			      " packets=%llu bytes=%llu\n",
-			   h_source, h_dest, ntohs(l2->etype),
-			   l2->vlan1, l2->vlan2, entry->ib1, ib2,
-			   acct ? acct->packets : 0, acct ? acct->bytes : 0);
+			   h_source, h_dest, l2->etype, l2->vlan1, l2->vlan2,
+			   entry->ib1, ib2, acct ? acct->packets : 0,
+			   acct ? acct->bytes : 0);
 	}
 
 	return 0;