All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Felix Fietkau <nbd@nbd.name>, John Crispin <john@phrozen.org>,
	 Sean Wang <sean.wang@mediatek.com>,
	Mark Lee <Mark-MC.Lee@mediatek.com>,
	 Lorenzo Bianconi <lorenzo@kernel.org>
Cc: Jakub Kicinski <kuba@kernel.org>,
	 "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	 Paolo Abeni <pabeni@redhat.com>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	 AngeloGioacchino Del Regno
	<angelogioacchino.delregno@collabora.com>,
	 netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	 linux-mediatek@lists.infradead.org
Subject: [PATCH RFC net-next] net: ethernet: mtk_eth_soc: don't convert byte order of etype
Date: Thu, 25 May 2023 16:19:13 +0200	[thread overview]
Message-ID: <20230525-mtk_eth_soc-etype-endianness-v1-1-b5da9258ed86@kernel.org> (raw)

*** 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 --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;


WARNING: multiple messages have this Message-ID (diff)
From: Simon Horman <horms@kernel.org>
To: Felix Fietkau <nbd@nbd.name>, John Crispin <john@phrozen.org>,
	 Sean Wang <sean.wang@mediatek.com>,
	Mark Lee <Mark-MC.Lee@mediatek.com>,
	 Lorenzo Bianconi <lorenzo@kernel.org>
Cc: Jakub Kicinski <kuba@kernel.org>,
	 "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	 Paolo Abeni <pabeni@redhat.com>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	 AngeloGioacchino Del Regno
	<angelogioacchino.delregno@collabora.com>,
	 netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	 linux-mediatek@lists.infradead.org
Subject: [PATCH RFC net-next] net: ethernet: mtk_eth_soc: don't convert byte order of etype
Date: Thu, 25 May 2023 16:19:13 +0200	[thread overview]
Message-ID: <20230525-mtk_eth_soc-etype-endianness-v1-1-b5da9258ed86@kernel.org> (raw)

*** 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 --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;


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

             reply	other threads:[~2023-05-25 14:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-25 14:19 Simon Horman [this message]
2023-05-25 14:19 ` [PATCH RFC net-next] net: ethernet: mtk_eth_soc: don't convert byte order of etype Simon Horman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230525-mtk_eth_soc-etype-endianness-v1-1-b5da9258ed86@kernel.org \
    --to=horms@kernel.org \
    --cc=Mark-MC.Lee@mediatek.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=john@phrozen.org \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=lorenzo@kernel.org \
    --cc=matthias.bgg@gmail.com \
    --cc=nbd@nbd.name \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sean.wang@mediatek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.