Skip to contentSkip to conversation

net: hns: use u32 for register offset in RCB TX coalescing

PATCH In review Agalakov Daniil 2 participants 2 messages Apr 20

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

PATCH 1/1 net: hns: use u32 for register offset in RCB TX coalescing

The local variable reg in hns_rcb_get_tx_coalesced_frames() and hns_rcb_set_tx_coalesced_frames() holds a register offset passed to dsaf_read_dev()/dsaf_write_dev(). Register offsets on this hardware are 32-bit values; using u64 was misleading.

Change the type to u32, consistent with the hardware.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

---
 drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/hisilicon/hns/hns_dsaf_rcb.c +2 -2
index 635b3a95dd82..3c4e4e8ca140 100644
@@ -563,7 +563,7 @@ u32 hns_rcb_get_rx_coalesced_frames(
 u32 hns_rcb_get_tx_coalesced_frames(
 	struct rcb_common_cb *rcb_common, u32 port_idx)
 {
-	u64 reg;
+	u32 reg;
 
 	reg = RCB_CFG_PKTLINE_REG + (port_idx + HNS_RCB_TX_PKTLINE_OFFSET) * 4;
 	return dsaf_read_dev(rcb_common, reg);
@@ -634,7 +634,7 @@ int hns_rcb_set_tx_coalesced_frames(
 {
 	u32 old_waterline =
 		hns_rcb_get_tx_coalesced_frames(rcb_common, port_idx);
-	u64 reg;
+	u32 reg;
 
 	if (coalesced_frames == old_waterline)
 		return 0;
Signature · 1 line
2.51.0
maintainer
#1 lore raw
Quoted 4 lines · On Mon, 20 Apr 2026 17:40:19 +0300 Agalakov Daniil wrote:

The local variable reg in hns_rcb_get_tx_coalesced_frames() and hns_rcb_set_tx_coalesced_frames() holds a register offset passed to dsaf_read_dev()/dsaf_write_dev(). Register offsets on this hardware are 32-bit values; using u64 was misleading.

net-next is closed during the merge window.

If you repost please improve the "why". As is I don't think this patch is worth merging.