From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0E5CACDB474 for ; Wed, 18 Oct 2023 03:11:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229512AbjJRDLf (ORCPT ); Tue, 17 Oct 2023 23:11:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58208 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229450AbjJRDLc (ORCPT ); Tue, 17 Oct 2023 23:11:32 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 29D48C4; Tue, 17 Oct 2023 20:11:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1697598691; x=1729134691; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=Yn9ROtkQUbrVMJYFJ3Gpu6KvcZ63WcxQJEA/jUOtYz8=; b=fRZYt6aJDfrFnNkg5i+HmjdQWhPaHsQIYz+5kmpWEd0FGHARM8Xmth9y 0Ch1TBIyJ5lQ2mVLkrcNLuP+rDUt2Ilacbqjm1RUfZrh8FlRJ2yWdxiEk 4VlfqRByX9Z3X5TyJFBglzoj8siq2H9sc55bYRZiMJjF6rSHU3I3i6aqw b0406EdQ9PbxWvczFp7ZpYVWzk48jBqV0iYgylJ7fippA9yP4LD6EK9b5 zQvwctVTtvy9KnLOU1eN4X2iDlKn9lX51at1RhWS2YKDHuyuehfTx7oqO I7uaQUwzfIS1cxcf9OIe1GrOGKf/ZE9lvxR8vOBzoQUTQJ9DgeQhJo5dg w==; X-IronPort-AV: E=McAfee;i="6600,9927,10866"; a="389802481" X-IronPort-AV: E=Sophos;i="6.03,234,1694761200"; d="scan'208";a="389802481" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Oct 2023 20:11:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10866"; a="929993822" X-IronPort-AV: E=Sophos;i="6.03,234,1694761200"; d="scan'208";a="929993822" Received: from ssid-ilbpg3-teeminta.png.intel.com ([10.88.227.74]) by orsmga005.jf.intel.com with ESMTP; 17 Oct 2023 20:11:26 -0700 From: "Gan, Yi Fang" To: Alexandre Torgue , Jose Abreu , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Looi Hong Aun , Voon Weifeng , Song Yoong Siang , Gan Yi Fang Subject: [PATCH net-next v2 1/1] net: stmmac: Remove redundant checking for rx_coalesce_usecs Date: Wed, 18 Oct 2023 11:08:02 +0800 Message-Id: <20231018030802.741923-1-yi.fang.gan@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Gan Yi Fang 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 --- 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 6aa5c0556d22..f628411ae4ae 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c @@ -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)) -- 2.34.1