Skip to contentSkip to conversation

net: stmmac: Remove redundant checking for rx_coalesce_usecs

PATCH In review Gan Yi Fang 1 participant 2 messages May 23, 2023

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

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

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.

---
 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 35c8dd92d369..6ed0e683b5e0 100644
@@ -917,7 +917,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
Quoted 40 lines

-----Original Message-----
From: Gan, Yi Fang <[email protected]>
Sent: Tuesday, 23 May, 2023 11:56 AM
To: Giuseppe Cavallaro <[email protected]>; Alexandre Torgue <[email protected]>; Jose Abreu <[email protected]>; David S . Miller <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; Maxime Coquelin <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; Looi, Hong Aun <[email protected]>; Sit, Michael Wei Hong <[email protected]>; Gan, Yi Fang <[email protected]>
Subject: [PATCH net 1/1] net: stmmac: Remove redundant checking for rx_coalesce_usecs

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.

---
 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 35c8dd92d369..6ed0e683b5e0 100644
@@ -917,7 +917,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);
 
Quoted 3 lines

if ((rx_riwt > MAX_DMA_RIWT) || (rx_riwt < MIN_DMA_RIWT))
--
2.34.1

Hi All,

Please ignore this message. The patch is targeted for net-next instead of net. Will resend for net-next.

Best Regards,
Gan Yi Fang