From patchwork Fri Aug 30 01:04:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yan Zhen X-Patchwork-Id: 13784085 X-Patchwork-Delegate: kuba@kernel.org Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2070.outbound.protection.outlook.com [40.107.117.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 86436290F; Fri, 30 Aug 2024 01:05:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.117.70 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724979909; cv=fail; b=h5MxffZgrM25+c/Bhzd+zHXqMF4Q2mSRXTDjaLy2u0l0wMSn5bD4RqNCUa7L8i8Q4HRiUgGdjaDtsmbPNR6lkDx5bH5LtWjKDta03IP9zNV2vZ4rLICWCsYgXIS5dH0ViSYaQ8WKtUWBHL2Ed9yEF939jNvnva+tlxboxUqK1sg= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724979909; c=relaxed/simple; bh=lgmZjne//nMvdsbpVYxxAgASyYUjDmSNcczp17Cv0yg=; h=From:To:Cc:Subject:Date:Message-Id:Content-Type:MIME-Version; b=cQg2+g17zX2gDMzpIeELkzMkfSDJN62tmn6QW5sq3zZLqio0JaKwaQcWt7IC40ENl/wyn0p964baQc1YMyLik1C+j3F/0R8+gM3zuZi8M/VwXIlSIl82uma3VC9Y2jGFLxkXLEwhh7QW8zoOJAgDxyX73lItG+hR177Dj16kHVo= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=vivo.com; spf=pass smtp.mailfrom=vivo.com; dkim=pass (2048-bit key) header.d=vivo.com header.i=@vivo.com header.b=OcRgIp+z; arc=fail smtp.client-ip=40.107.117.70 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=vivo.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=vivo.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=vivo.com header.i=@vivo.com header.b="OcRgIp+z" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=yf6kOgoSi+pnQydVsNY+3XALd2MvZ2jfeDy8FOafV+NdAiyajBAUfBKp/+IpqFf3WhPi3ro+ilPD3Np7PJlh23Zz3+TW9UtpopnvVdcJNOh8O1OuxNN7lr9CcGxxFZbLHR8mXAVR4kSt2SZnXMn9vKvRY3M3newOOcFIny5nSKcKFc0Cg6YdFEax3hzvzpq7zETMW5TNCcdUpwzPFfQ1OauFoUC56Af+JIpvk07BELrdKY58THUt+GwhzzJeyNl3t1QXyK70CKg28v0SoGpXVi/yG4Vjmf5APC2UZ8EStgJ1bszqKo++h+AMlaJyQPcKUXfGzA9xIbLHroCGwjVyJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=xogr3StArr1bHW4A6OTM+1Zk6XLLutcRGUvtLMbCEMc=; b=oqGrCkxqe0IBse1g9/tzzM/gMipteOqeeDFaThff5XgmxDurpIKdB6oDQpiV6sZAW6AGquFwlAleLKjlY23CCEU0M2x+UP6GiqsArrkuVUAE9Bj4Uk21ctHvu/V33b/eehvsac5D2rjx5o7Pr0yCWU/cLfCRnQ+VVpE6uLw9tQzaC9X+Zcq177PmQC7kuyl1gRsPuoLFoAH2B7195rOImHaKG+gtUixd0FLoARACWJTK2tldPdbQ4mgBrTEh++IO6Xg00U8v2LnPpJVVx43ZPSFgo7O1p5RtR+Un+uClbG8JNvL1/IdNSQquegGswX+CQa918WOQTq7dFXsgxXZhpg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xogr3StArr1bHW4A6OTM+1Zk6XLLutcRGUvtLMbCEMc=; b=OcRgIp+zaJPdSF90ZNMjpY4rc21NW8xuV2KIbxuvRbabjGyOh5jCDGT/EyJ0Gi4ANrUooGxUtMGCEF3SIsLLBzFIPzjaw0qOQ5KZy83/GLTUUmYgZUy20aZsUCwAaJ0rJ1P6k/0/41usndjO6H5Y0TsJ9gOU4A5qKAlEApRoHXTnmq4ugjLTwit6QiOPdrPSunjoUQcgaL14J+CrARgnvs1N6xOJ33Q/7Gn58imYo/bzrYjmA5dzFqbqdsIo3V6NneXWXLNCl27qWu2XVtnQzWitM32K1QvMbzK0ZuFZCEX9NN/FhG2LlmiTQ//Ew4MsBhTKlb3BcOfIo9uNn2IuOA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from KL1PR0601MB4113.apcprd06.prod.outlook.com (2603:1096:820:31::7) by SEYPR06MB6613.apcprd06.prod.outlook.com (2603:1096:101:169::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.28; Fri, 30 Aug 2024 01:05:01 +0000 Received: from KL1PR0601MB4113.apcprd06.prod.outlook.com ([fe80::7e85:dad0:3f7:78a1]) by KL1PR0601MB4113.apcprd06.prod.outlook.com ([fe80::7e85:dad0:3f7:78a1%4]) with mapi id 15.20.7918.019; Fri, 30 Aug 2024 01:05:00 +0000 From: Yan Zhen To: marcin.s.wojtas@gmail.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, opensource.kernel@vivo.com, Yan Zhen Subject: [PATCH net-next v3] net: mvneta: Use min macro Date: Fri, 30 Aug 2024 09:04:23 +0800 Message-Id: <20240830010423.3454810-1-yanzhen@vivo.com> X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: TYCP286CA0353.JPNP286.PROD.OUTLOOK.COM (2603:1096:405:7c::10) To KL1PR0601MB4113.apcprd06.prod.outlook.com (2603:1096:820:31::7) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: KL1PR0601MB4113:EE_|SEYPR06MB6613:EE_ X-MS-Office365-Filtering-Correlation-Id: fb4986a7-7899-405e-bb2d-08dcc88fc5e3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|52116014|366016|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: RSiP8YY5ujvc2wqHiCHv8ow22vy4LTcJRZQo9eAx79kWNrEF/g3ZLw7Fee1boioUEcH9axkyw9iayZJdW9HszU70wY4iVuxfCRKQnSst61PVbEwZ/cUnYnAhNdiGSOmQv1eoPTxwityN4Ep74T9DZTEHsnZIIfStz63UkLx9CoAGE3JC6thl1MtZ84yQ3IVq7iMCAyRWQfPJtCj3XHX0O5gEclnjooRaQKDCYLds+jb9qOTfvVU+0YMOfJBZ11KwFdynwDiVVhqRRKzwWAlmdDclFhaFZxx/h6LR8aupw+u9EBMIvjPQQSP7pCt9ROfMnU/HQnUXiHD2N6+/qMB5JOljCVI80Ljt3h/VX8sgEhHjqsvHi91hAvTN+8f/ex16vjaR6684mkkYQ+Sbr6B/SAPouOAuFp+ly0LOQEDB7BsFPi86qN2lGqxAfet+dub3TGX85DgwGEAgDyCzbEGiQJfozBNl+mehQY8x5G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52116014)(366016)(1800799024)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: OO4YsUZUKFUwpkoHPXzV6hedU0A+/J6doxHZEClMK+8pAPNLjjOPBm/SKTTXo522yuc2LQU4sULVinudeQJSGDtpJzW4RXq3SDUUqnon2Q+3NYBn57GUR8kkt7sGt93nRWPVUhF9r+UnnND44e0zA27ITD6B7XYnjU2MdEe4QnLalBgj72JPLrte5vJyRr5/qCBuLo/+dc15vArsesu9bVxDXtfxhBaUyT984ZpHZVcpFTvTnKebMFtT5KCixI2QpoOQ9vLwry4K2b4pqH0C34C9P6/3LbqGI96xBcJwcFOlr7hiYIhMFyRhWBI6wtO3DHBP/sG4Ie4dk8lfQfU9MQnk2s6IAREnjU7PzecsT6vfD84/sEY9M10DAhH0H4dlmr4dREeBriZk/AQ8DoS6029a2ULqUPRHviH42W5lX3RGr2grVoVK7/J3KOmHO5dga2t2gSeObVN9Bg3LRVxaujybE7UyPYykxyg5xL1yB7xmfiuhT5D7o1y6vc8HWgLECQp3zP0uxkYkqf4+t84WlJbvAcWY3ZXQPqYhAN8wZxnTNSs+IwkAvvbHIWe/9+ioHzXPFdwp6+/3u/UIVmC/IHPvUfrnhoODKozcyrepY3IwFvcBv8+0WuA8m/xJkCw4XCzj4UJUZBfYbuL21yyjpBoKGuLnEPmgJoXh0Sul3RTr1SLvO+Gg9cFp/OqGrF7eCFU0bP6pVviThbrhXNA3Fdv/IExBSBBPreLhsihZ+tg81ompiTv/sqHezYgCuqsvWKCLbbYchfM9ZGiXN20CdvCVolU39jQ3/A5yREQfjP0lrW3XIHJ0flrXh5LgfgznCqF0y+/RfVxaUUzquFajhtGLTl7cygTJLpy4Tax61K/DuO+sfELDkjxy68aevW0xKzKvULyNmlT3mQFEzcIU2gHfCpw7DJaK+l9cHaNQZUgdM/x5wYb88B/9OvJAB2kEVf38e1lMoAvVp9gGm12BAppQosTdP/SCUCk5FvQ1uXfFnom2xFjSceQS+YfMSBwAg12seYgY4L+B7CK1/K9C5Tivl5jipH77giFBfALL9t+3gfv+YehGwdrtetWfVJIxR09PegDLtsPYurZWX/PXjk9DnbYO2zNFKVLoaMIQGl5YK81aPPEwQghdAO9xqywjCVaw0+1A6v1xM4sFoku3UxY9dZQr7VZQCCD+fZB3vJdw/WsJlPVHzYv/AGPtSWuXb5c0d5uJBFWnIrW2xH/jYvcizYy8juDtiQJaTu1nUpyCzYPmvmCm+F7yeXTSHnL4Q/X9XXLbJzAle12zj/AZ3WDJF2JCejdYMH7bDZnvPe3UyWmmG90Fifgis4EL9vPWgfvyq4fbiIA2B/5Le5oGppiqUsog3hC45cnHnYNlq2RpMJknDgAaIZ4yEUxiZCiIAgvQLAVCry5RURctVy0FzSdFhq1b4f0nWQijfYKSuGrSIGmXSGInbG5bUaT3tF1n9naOBnBIN+55hbj2WYnMKNK9eZp+uqS31k2KSzcR+PO7YVUcg/8QuVutiVXTkx5pUnjUAuz1dWsnPVBc7P/efEV+I9wxg2VTx0OjQlbDa+RlRC7DwMGCo9JN1P5zMGbC X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: fb4986a7-7899-405e-bb2d-08dcc88fc5e3 X-MS-Exchange-CrossTenant-AuthSource: KL1PR0601MB4113.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Aug 2024 01:05:00.7803 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: KuSK/hOr2emtny/AwPe+Vq5oCj1dNzTiE74gKY4ziOeK+PiwjSpx0f1tXKdFVWH0YfvoIj+zODgslrfLW7pcew== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEYPR06MB6613 X-Patchwork-Delegate: kuba@kernel.org Using the real macro is usually more intuitive and readable, When the original file is guaranteed to contain the minmax.h header file and compile correctly. Signed-off-by: Yan Zhen Reviewed-by: Simon Horman Reviewed-by: Marcin Wojtas --- Changes in v3: - Rewrite the subject. drivers/net/ethernet/marvell/mvneta.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c index d72b2d5f96db..08d277165f40 100644 --- a/drivers/net/ethernet/marvell/mvneta.c +++ b/drivers/net/ethernet/marvell/mvneta.c @@ -4750,8 +4750,7 @@ mvneta_ethtool_set_ringparam(struct net_device *dev, if ((ring->rx_pending == 0) || (ring->tx_pending == 0)) return -EINVAL; - pp->rx_ring_size = ring->rx_pending < MVNETA_MAX_RXD ? - ring->rx_pending : MVNETA_MAX_RXD; + pp->rx_ring_size = umin(ring->rx_pending, MVNETA_MAX_RXD); pp->tx_ring_size = clamp_t(u16, ring->tx_pending, MVNETA_MAX_SKB_DESCS * 2, MVNETA_MAX_TXD);