[net,1/1] net: stmmac: Remove redundant checking for rx_coalesce_usecs

Message ID 20230523035548.188651-1-yi.fang.gan@intel.com
State New
Headers
Series [net,1/1] net: stmmac: Remove redundant checking for rx_coalesce_usecs |

Commit Message

Gan, Yi Fang May 23, 2023, 3:55 a.m. UTC
  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.

Signed-off-by: Gan Yi Fang <yi.fang.gan@intel.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Gan, Yi Fang May 23, 2023, 6:05 a.m. UTC | #1
> -----Original Message-----
> From: Gan, Yi Fang <yi.fang.gan@intel.com>
> Sent: Tuesday, 23 May, 2023 11:56 AM
> To: Giuseppe Cavallaro <peppe.cavallaro@st.com>; Alexandre Torgue
> <alexandre.torgue@st.com>; Jose Abreu <joabreu@synopsys.com>; David S .
> Miller <davem@davemloft.net>; Jakub Kicinski <kuba@kernel.org>; Paolo
> Abeni <pabeni@redhat.com>; Maxime Coquelin
> <mcoquelin.stm32@gmail.com>
> Cc: netdev@vger.kernel.org; linux-stm32@st-md-mailman.stormreply.com;
> linux-arm-kernel@lists.infradead.org; linux-kernel@vger.kernel.org; Looi, Hong
> Aun <hong.aun.looi@intel.com>; Sit, Michael Wei Hong
> <michael.wei.hong.sit@intel.com>; Gan, Yi Fang <yi.fang.gan@intel.com>
> 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.
> 
> Signed-off-by: Gan Yi Fang <yi.fang.gan@intel.com>
> ---
>  drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
> b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
> index 35c8dd92d369..6ed0e683b5e0 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
> @@ -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))
> --
> 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
  

Patch

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
index 35c8dd92d369..6ed0e683b5e0 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
@@ -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))