Skip to contentSkip to conversation

sun/niu: fix wrong RXMAC_BC_FRM_CNT_COUNT count

PATCH Applied Denis Efremov 2 participants 2 messages Mar 5, 2021

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

PATCH 1/1 sun/niu: fix wrong RXMAC_BC_FRM_CNT_COUNT count

RXMAC_BC_FRM_CNT_COUNT added to mp->rx_bcasts twice in a row in niu_xmac_interrupt(). Remove the second addition.

---
I don't know the code of the dirver, but this looks like a real bug. Otherwise, it's more readable as:
mp->rx_bcasts += RXMAC_BC_FRM_CNT_COUNT * 2;

 drivers/net/ethernet/sun/niu.c | 2 --
 1 file changed, 2 deletions(-)
drivers/net/ethernet/sun/niu.c +0 -2
index 68695d4afacd..707ccdd03b19 100644
@@ -3931,8 +3931,6 @@ static void niu_xmac_interrupt(struct niu *np)
 		mp->rx_mcasts += RXMAC_MC_FRM_CNT_COUNT;
 	if (val & XRXMAC_STATUS_RXBCAST_CNT_EXP)
 		mp->rx_bcasts += RXMAC_BC_FRM_CNT_COUNT;
-	if (val & XRXMAC_STATUS_RXBCAST_CNT_EXP)
-		mp->rx_bcasts += RXMAC_BC_FRM_CNT_COUNT;
 	if (val & XRXMAC_STATUS_RXHIST1_CNT_EXP)
 		mp->rx_hist_cnt1 += RXMAC_HIST_CNT1_COUNT;
 	if (val & XRXMAC_STATUS_RXHIST2_CNT_EXP)
Signature · 1 line
2.26.2
#1 lore raw
This patch was applied to netdev/net.git (refs/heads/master):

Hello:

This patch was applied to netdev/net.git (refs/heads/master):

Quoted 10 lines · On Fri, 5 Mar 2021 20:02:12 +0300 you wrote:

RXMAC_BC_FRM_CNT_COUNT added to mp->rx_bcasts twice in a row in niu_xmac_interrupt(). Remove the second addition.

---
I don't know the code of the dirver, but this looks like a real bug. Otherwise, it's more readable as:

   mp->rx_bcasts += RXMAC_BC_FRM_CNT_COUNT * 2;

[...]

Here is the summary with links:
- sun/niu: fix wrong RXMAC_BC_FRM_CNT_COUNT count

    https://git.kernel.org/netdev/net/c/155b23e6e534

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html