net: stmmac: Remove redundant checking for rx_coalesce_usecs
authorGan Yi Fang <yi.fang.gan@intel.com>
Wed, 18 Oct 2023 03:08:02 +0000 (11:08 +0800)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 19 Oct 2023 10:27:23 +0000 (12:27 +0200)
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.

Signed-off-by: Gan Yi Fang <yi.fang.gan@intel.com>
Link: https://lore.kernel.org/r/20231018030802.741923-1-yi.fang.gan@intel.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c

index 6aa5c0556d2203fcc2edd0307974f6e0d40ffccc..f628411ae4aefa727fbbf8ab21ad7b392dc8df7c 100644 (file)
@@ -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))