Skip to contentSkip to conversation

net: stmmac: Remove redundant checking for rx_coalesce_usecs

PATCH Applied Gan, Yi Fang 2 participants 2 messages Oct 18, 2023 – Oct 19, 2023

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

PATCH v2 1/1 net: stmmac: Remove redundant checking for rx_coalesce_usecs

From: Gan Yi Fang <[email protected]>

The datatype of rx_coalesce_usecs is u32, always larger or equal to zero. Previous checking does not include value 0, this patch removes the checking to handle the value 0. This change in behaviour making the value of 0 cause an error is not a problem because 0 is out of range of rx_coalesce_usecs.

---
 drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c +1 -1
index 6aa5c0556d22..f628411ae4ae 100644
@@ -981,7 +981,7 @@ static int __stmmac_set_coalesce(struct net_device *dev,
 	else if (queue >= max_cnt)
 		return -EINVAL;
 
-	if (priv->use_riwt && (ec->rx_coalesce_usecs > 0)) {
+	if (priv->use_riwt) {
 		rx_riwt = stmmac_usec2riwt(ec->rx_coalesce_usecs, priv);
 
 		if ((rx_riwt > MAX_DMA_RIWT) || (rx_riwt < MIN_DMA_RIWT))
Signature · 1 line
2.34.1
#1 lore raw
This patch was applied to netdev/net-next.git (main) by Paolo Abeni <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Paolo Abeni <[email protected]>:

Quoted 9 lines · On Wed, 18 Oct 2023 11:08:02 +0800 you wrote:

From: Gan Yi Fang <[email protected]>

The datatype of rx_coalesce_usecs is u32, always larger or equal to zero. Previous checking does not include value 0, this patch removes the checking to handle the value 0. This change in behaviour making the value of 0 cause an error is not a problem because 0 is out of range of rx_coalesce_usecs.

[...]

Here is the summary with links:
- [net-next,v2,1/1] net: stmmac: Remove redundant checking for rx_coalesce_usecs

    https://git.kernel.org/netdev/net-next/c/392c226cda94

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html