From patchwork Thu Aug 29 03:19:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yan Zhen X-Patchwork-Id: 13782413 X-Patchwork-Delegate: kuba@kernel.org Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2053.outbound.protection.outlook.com [40.107.117.53]) (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 AA9031B7F4; Thu, 29 Aug 2024 03:19:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.117.53 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724901570; cv=fail; b=B56Kq+KfSrLaHoWERtHLbXMH23QBQrto2gZ4EQGD8FS0OXp4RkBY9UlA1RpN02sZt9xxm3EaRud2C18BvGjSTz2krtJOa1j+GcqSQ+aiHAfGp6yPYs2+nm4KIAzO5pfHkFhL9d6I0vL1ca4v6+CeaiLjhadPEkQxV0+CeA7m1ok= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724901570; c=relaxed/simple; bh=3sOKQfPu21xu4da2YFpOYnA4x3H8LFgxV2fr/Fe0LF8=; h=From:To:Cc:Subject:Date:Message-Id:Content-Type:MIME-Version; b=kYf4b1V/vwRCwLLEDtDnxXTvEsEmSOfpdnhsYkfg5Na8mWzbUIhq+LDHL3NQFYcLapCWyGPU0zW3GzZZt8yGVBP1ZxSHQ3URnxvYd8NXLWsv4PBWQ9S3t3ljkebrqWPt/W3721Cu9/yprlmB/c0ayZg52+5rQkIzcHXdvtZqFmM= 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=J6Q8aqN0; arc=fail smtp.client-ip=40.107.117.53 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="J6Q8aqN0" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=HVsGbm+FJVyIZ7MpgHulqPmjHv1SIGMhapW9LN92aRiB/aarNrMUXJyIGone7gENZcIScIL7KBOGOc8ztkxYtRgR6YyJ/1Zck79ul+1XHwqP31VDoymi/Er79HxwPPBx5SGtMvA5P+OGnr5XWfKWfdWRIBVTPLpXNpZS1gSaJso1g11WeDQQOwucwLpgw4Q4x862HMyKctamU5amoAa+978o/zcLnbI0Xj4lswY3LO8BriW52Oy/m7JFNkxIq29ythkpn+o8qUgdIkzOG1w21FeCAYMTy5S1F+GPaPhQ6DCzNRdokrt9x8mOK77TJhRdP1XhsDF2I+hOuCcq4YxoQQ== 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=wkiBpToYSULnQ1jcEw7OLvflE5caJXbxsND2UxGQ3gg=; b=mtN8HPDMSB/KzOHbkYOztb3oyKO2iyHSJWRdZq0Ao7eLiSfpic1NSlOOAmPeql3Y1OLA18lOrbT3HCti9Y9SU77y/vfrxnJFv/hN5ee9qP9juvtOgAOMMCbwJiz1qZER74GRersp4cPi4AX5JCb9Qxb1cKFs/bZmYjAKDSb7mt4srLPGsjK+Augl8sw9PUn4V9PH1i41zuPG7Og6vkd2Y28YD2MpVXmXULhWh603J7Ps5FNo2LYmEtKtlhTQcZ3jnORhyjYgX4sknHtlq5oBVHUQaYz09N/bW45/ukARR9v0E1ijTkhv5acb1kuozOAzUTyKWBdk2YHbUiYtJH1YgQ== 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=wkiBpToYSULnQ1jcEw7OLvflE5caJXbxsND2UxGQ3gg=; b=J6Q8aqN0wVJu/FtcnSrYr+RuIrpmsnMa4pZAiygmWr21ZNrB1iLovYuA/30EdkGFaTBMZwYr8LzVzi+OysoRH9+QRRxsdBbUgJp4lkaQVx7qESBK2S30Vam6mu/p9hoBmxHs+kpIwLLT7Yu4jsqWP2R3/8MNxkxNP94xZ/odyGQPcfRNjQ4nkKtWx6Wz2U9GZ9JPyXFclIsPZC6OxK3VvL1tjCiuHPIHAp0JVRxutl3/Ki0GCbL+1/bFsllR1sM9GZwKEOxq9sScBTqCkZkw8W/snkUUF1sGb/hBJi94nR0TAxaG+zPYDEzk4NYt2I3lN870bihMNxVZ1Te4MAFM1Q== 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 SEYPR06MB5184.apcprd06.prod.outlook.com (2603:1096:101:89::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.28; Thu, 29 Aug 2024 03:19:22 +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.7897.027; Thu, 29 Aug 2024 03:19:21 +0000 From: Yan Zhen To: kuba@kernel.org, marcin.s.wojtas@gmail.com, davem@davemloft.net, edumazet@google.com, pabeni@redhat.com Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, opensource.kernel@vivo.com, Yan Zhen Subject: [PATCH v2 net-next] ethernet: marvell: Use min macro Date: Thu, 29 Aug 2024 11:19:06 +0800 Message-Id: <20240829031906.1907025-1-yanzhen@vivo.com> X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: SG2PR06CA0203.apcprd06.prod.outlook.com (2603:1096:4:1::35) 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_|SEYPR06MB5184:EE_ X-MS-Office365-Filtering-Correlation-Id: 8a2a7875-5bba-41d2-e60f-08dcc7d95ff3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|376014|1800799024|366016|38350700014; X-Microsoft-Antispam-Message-Info: atNDWa87ibAxa/b2yngtlg7YArNV5aHYHp/xgEE7QgYSaToZSwAfEgRijUZvckoKPwqhCXDrpYfHmNtklyzQwrAUKQw3QoQPtDIChKi+cL5Gf5JhkFFQyH06JhFPDs7LApQQmmXMQ5FLjf8E9LQHEe/BO1J7lUPnIk5ROfa24MYxhxfiaEbn2a5WeKkPDw49H3YQKO5rsXbwm1OWLvxJLUUZHKw2PPVpwjq9Vt+z1b8vpiWylVGqwRJoVheZfB/5+Y0mt+XZecMJPcsyARNuJE/5h4k75P+nnVMgetH6M08GzzezSV3UZG2TGOKaBbvHy9z42It0Zx4z3Juo141o11o8o2+wC54/uG1oPWQAKNI1WHpZBnjPvG/wyKG+QaVefM4LOX651N+71F8kFuskhSSDTPNMqj9zaS7fTmPPp1QzFZ3GBGExjP0xiCVUJRkdho/DmLzxU3843KX2QBoxQ6L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T:NONE;SFS:(13230040)(52116014)(376014)(1800799024)(366016)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: nRY2OPc++PPkVMR51NnhmBmzP+0CGibhZB3UmYvFO8IA0kM+BRWu95vH8hzdt8DBAzcTWkZzw3hxs31oq9gMlXRk9Rfr0T0dVAiHVIW4CdK8wcL/SJLlVQTVZf+7rBLu5yI4My0MOPStxWTzxA9aYigvPYV7ymN4rDD8BKhgKOm+aSiXpWhnaWk2YLY9kOTXpEBzeFwjZlh0uO2fVHSWx868TYPxNifMsOZRcXn/Bfcr2Ass2NRhDh6SOiz+pYA+uo4dmMjUoVe6dQdp4F9BM8yRq7kz4FeqQ3BPpiqWV0OP68FpFH2ernVcDzngzneUXtlrYay8cym8IY1o6hk+XSeROHmHO4ryyrZKm5zd3lB4y+NhmeRdttNiE/oqW3sZx3U09QroKmUSuI9zbdAo9+/5hTyAOhgKh44NxuwxiR2EI/RI3aRZfSqCqnIheWjPMwcU+7Y1RKmnR5TgrJiD4OmpBoK7+3RN7dGfLQ6NVX33gs7EKYSw1o2uvelJvWzoKg0VKp/VokZLTztYnUzBopymLYuEPahkr62pNtBDgkwlWMO1ff0+G2zdDMDxYQBDmrZ2sEsciT5AfBM7Leet7Zr7EsuEyLuOZCgTjFdCsp+BHiJrjEgw0ks8gQkLUWYM/vSVHXSRPQzKkIrmtyE+HHVC48unLWQYLgfBDkqu53do0X/DCbSI4Uctnc4j49y8ZXUNzs9Q9FMYxtdWEIIyeQvhnlQ5nIghtDk8BafG8B2PfTDPOWDP7uVaAqK0bYi4LIv4dce5vbESQY4Fypn9W0NOKV+JyK72sWXCCpX6v4e/SMOLZEXiylv7+vMN1vrvpQQ2bbtFTSHaHLJlbOWGz59a9yLlhT4aC8Gdt2v0aPrMLskGaPp/N1uD15wwn3JdUYyvIb0CrscPIqumXQjbH5ZgiPXoydqHQXNoaoEOilPS4YQbyWbYQLHx3ztC2S1HXmE69cCbn8efmTxpYHFpKnQTFviFPqBAalr5ZIBCe5B89FzWAMiI4wa8bu1u5CWR6eh0Cp5sPmXDpDnYnCqy1V9XPJQShKkFeY9HNlSDerI0ZYuXzAtu/6kGDQEZ03sCgVK/RPbuX8+q720L67+Fbe20u2Op614VA59H4RkncC16zHM75c3t54cHHT3vN9886JS+odMgomCN5qyylchASVFTL5PTuwzhN+VPlCq1Nv4f7jHd8GbnFYxBz1iUfoQ6GK1D3GNUA2syjyNGbf6/oeiBPEXG+rM3fOHpmH38NM0Oasspj9gLDv/WLjcSLB9RLRILAE3VV1FRzyDT9XZLMm41VHL6pi6jPGqHXIuD63mXbxMCDQ8ALdkU4dUjkgkhIX5Faxoi38PAMUxjrPCorYfHJd6VJ56BQSJt7xz609sPBJYjMKZpqKUQ7U9mnRrkCnxoOZo9pj6Z+7fqsO27/qbvXsy65l59TVx3NTR0WvZXrPQ3gA0cMPXBq7zt4IGIL2X1cFe9josJYj5VA5W1VpGDBl9yLqM10Rci6hnlZ9684zgbnjU5vL59vP/R0b4071t3suPjKdtckCt/tgISN5W9Rts/pXT2y/MiGl3xyVF0NoabhajcRo5Sjfz7G8Zy X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8a2a7875-5bba-41d2-e60f-08dcc7d95ff3 X-MS-Exchange-CrossTenant-AuthSource: KL1PR0601MB4113.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2024 03:19:21.2996 (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: 33op3C4QQ4XygQ2TNPVbqoo3iXFx8I0Dd8gBEMBuJu1RZ3wnsdcec3yfvt1bCsVlsQNAsm+f0wJ6n2STL1I9Tw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEYPR06MB5184 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 --- Changes in v2: - Rewrite the subject. - Using umin() instead of min(). 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);