From patchwork Tue Aug 27 13:12:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yan Zhen X-Patchwork-Id: 823459 Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2047.outbound.protection.outlook.com [40.107.117.47]) (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 6829E1C3F29; Tue, 27 Aug 2024 13:12:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.117.47 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724764381; cv=fail; b=s5BsfSIRQvpkiTg+tvPY7hV79tb5qQJ5H0QcL7nUbV+3ahiRKZuJKUMbMk8xDiiZQXSxPabbT3hGIMPmktHqW0kRvqhI/KkSw/nGiemzb+XDqsU8ebHuZGAqEZ6k3zPhtsFU391SkSRALCUjoQSHJDr2kYw9xqafM3D1knvBLs4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724764381; c=relaxed/simple; bh=hKMZMAiBVQAV0/4cx15C+zIYSk/eEMmOvi5YDf94nPU=; h=From:To:Cc:Subject:Date:Message-Id:Content-Type:MIME-Version; b=iyLWaZiUDhf8r2w6nF7hbOSuLdXB1rFbyKqOT1qTI6rzc3ZvmHewyromd0d5QjnDALUOFMMTImZPl7xiuXPuQuYcpIkcG5b3YZgq+ir5uExf2+sPocRRmzklcJuXJYCFWeoJuZu4ngliXwbafLBg5vSIDaamxk/JteigZRi2AKI= 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=CK4Ujuvc; arc=fail smtp.client-ip=40.107.117.47 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="CK4Ujuvc" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=t6P+3n4GdPQ3ZkIlcQgnQN6QXJtpkyL8CbPJlD6b2BduP4Um1Nmi4uDe2kVBHI6D54HNnV/YaZX0elzqjtHvDzV/y23/y0V9dkc7Qzyhd7r5KVSGYooy1GCkfSPOYx61jfnkcjk/KQAj18JJPaqbWYQN7FHWXplX88L6amg/pSl43IQZWUqbtHTY1BUm/4Ut5+vNS/XXrFa2mAPtyM2mv/y3hSOGN7CR5jgMq83O+KjiWbPHsZW8or2UDlYBEQ6wnwnUyGCTrVu9Pjv9JQH1cO4GxEEwJxJa9QaiMMhzu4ZSNBIIEA1VtiPGozkQwYNB6vKEOaxw/WdnK9LsH6yWMw== 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=Pa8B2YuLfFlVC48CUJ5OkES3kEuIlUF+Rjl2IgbMwns=; b=osDfPiOoixfl7WMkn7xwJvlyYozuBBtaZCL49+3rQQxogVqCBnGDYo1HCFyauENwRxoUZ7OOd3BFYx2O+bmocPrhhF6+jPPNh3sapOqn6VV6YCKyRXzqhpR+mpYFyLDxkVgwfyxPyixDFmFCV2Fy3hnsRksIfxP3jU2v7QQGFtjyT9mA42I9uTXN8MtXkv+Rk9CnWiQPtkP5raOjf4Jkok/1sY+YmyZITPsPvQB/zPbkT41IzWYPDYjtIbHg5QAnAg21cQysxrnYupwJZPEpezVbjRdl7IITcCiCd9HPtnemTaQnrde3SMnR1Jy7/zLtDzcm5Yy9WupptXDweCF9fg== 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=Pa8B2YuLfFlVC48CUJ5OkES3kEuIlUF+Rjl2IgbMwns=; b=CK4UjuvcZ5tHIEMB2DoMWX4I2yrBmJkZoDmcQNb5HP/SR5b8H1ilqprf5AWXrOBX5DtShWTp5+IOvoNzcdsPMhUbu1iWU++5qDFBePVaIXQVbxIcEbA//0rx2W2XZg8f6kh4nz+OwMucfAGDCRiTsBGH+f1UocBKKYxUZOmFHzfRQ+9GodZk/LnJnzn/wKjoOWmVeGppADEVT5fytSCW/eeNkBozxsoFkILEU4KBbe9BJgv0jX3lBSJeGp+rObtt2kJU5EqyjkYSB8SOrRTiPSZ3ea7gf/FLrFvbo0bqe8MTvsLMriaQCOtxvA2YwQ3ZaECLZLODxBSxGUhIEeq6vg== 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 SEYPR06MB5916.apcprd06.prod.outlook.com (2603:1096:101:dd::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.24; Tue, 27 Aug 2024 13:12:51 +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.021; Tue, 27 Aug 2024 13:12:51 +0000 From: Yan Zhen To: han.xu@nxp.com, haibo.chen@nxp.com, broonie@kernel.org Cc: yogeshgaur.83@gmail.com, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, opensource.kernel@vivo.com, Yan Zhen Subject: [PATCH v2] spi: nxp-fspi: Use max macro Date: Tue, 27 Aug 2024 21:12:03 +0800 Message-Id: <20240827131203.3918516-1-yanzhen@vivo.com> X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: TYBP286CA0011.JPNP286.PROD.OUTLOOK.COM (2603:1096:404:ce::23) To KL1PR0601MB4113.apcprd06.prod.outlook.com (2603:1096:820:31::7) Precedence: bulk X-Mailing-List: linux-spi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: KL1PR0601MB4113:EE_|SEYPR06MB5916:EE_ X-MS-Office365-Filtering-Correlation-Id: b155f3d6-9b5f-4518-b5e0-08dcc699f492 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|366016|1800799024|376014|52116014|38350700014; X-Microsoft-Antispam-Message-Info: hdooefM7LFYfR0GEHzVkGdosZkXxjws+HDMw+fmFggg4/5z2VtUy6lXNr/+YVJWygkOq9k/d0ULspq8e9hm6JIf7hQuzVNgsrDaiQSvnJnEYIojrDnEba3bponM/F0EJcut/stB3QfrFTejHtiJRp0mW0tJXfOZUvZBVdH4RQ5l3JTh6mHZ3R2c5I2Li2aUr3ne4AO/iJ1iqn0a3soAWXMaVTbYyOYBybd5PIix3/RFyhlQoZ7VWTCTE2BmPkF6+QC7uiPnNfcTqSuUpPASD7etdz9nC6rZxpDdZ+bY8bgzg0ykYUC2IEt4NG/85ylbxKpUw2FS1ZlB9kQ0/KbjHv/RQlM5iD/uTsPq81geSrXI3NcuiZYcmQoXrjpzDsokJDsyQ0Bio/PKwn0OuaUbOhocMzoFX0xPqkaF9vd51V9pvwsf5m4QT3VXZuhqk639qr+G8rlw0nFO5FSAl3D0Nj1yFxZNEneP4fE3KrCMU6Zd6ehFO4K/JGCdk2Anb5+DgAQmY1asRupz/sBiYG75z62leeugjvzN7Dycrf185XO6E0C7c0pzdQJwRcxYRso0Fna0iEWiThdi4cdGnenOpsqHPzxRcPbVeBwQezhl694JyrnlgAefKR6PMAJOHZ5iGBVKdVU5QO9vKYrc8H0NxWAHFHT+mRVMgKmZ7gMIwdBv7RTe3AN4UHO2Hq7Odi+5SAGxj7H8TI/BulA5flvOcyXL/2uE7pphQb1i8rwdXOywjri4h3BXbDEaCi38ClPkdXKCvs2TyqHgyv8agkzZgFZ2zCJFhMPlsP7zI7+JhHI9NgDCONvpsYvLhh9/TnRFY6gCbAwcAixO8UHZosVmK6gkcwg56XebQAu67Tsfg5yS0UIy3bsx9XSKRDyLPmjOlcuACOpig14sZsHSHYNREW7KodYbObpXQTexE//qLpAwI48cFsv/WDRxwMwVByj6F7HsBFBneysLnjLe1OhDZSWkneDv7JxMedM8k3kl1kItXUq4cm5SvgQwGtw0P/vUR7w0ungLXEDb05lDlvoRahBakAxU9CyG4+kZ07Mh2TLa76i7kRkTbUOONmfZnIEyBQp+/p7dWtLiJ05WWt1XFj6eR0fg8/ORAkrGTcg8K0Q1h3oOL8rpmKu/ev//Qec6LwQTEZNyNp0eytRb/FXr9yDR9RkwcNL+bGNIJnaFwfKWXruob3CrA874bRgyhgWZH8Ufm2Lgjd2UVbvkmvWKtH8/40C+gy1XWQdj98Gg+J92DHAax10MNwI53Avg/WBphqNSBYRhybbENpJXICSSD48XpX8MJsfthxPbCdjHplPRJI3qd0xyWhQs/qqlvGCee1dN2iULeyQ1C74ZUujUtSayHStAPOO92K6f9SHEsPsHvv3mP17LNuGxY7roT5VicOApbX6EqERoQK6bmY8iT0Q== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:KL1PR0601MB4113.apcprd06.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(366016)(1800799024)(376014)(52116014)(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BgqDc4OlNdhlYPiRVRpc3Cfta710SMwo3UyE08PAE/cGIPvP+0Iw9LxXazU2PK/IKzfygXorCSwqLiMwQf/kTqYIclb+66ppb9FuxYHJJ0s0Kl87hJfGH3LGzd3CJohV3t2Vr+4DONoOPIIujqDx5R0824RwoJyjCwec0wX/jBNTVsS4ePdzJiQUDmX/dcswkM0+3CO7pzPm4Kraa2WIAZKWmTDLjqE7VdnXMT8wDmLxAuyYsZ0oy/xJ9/pf0RzX4SIlPHJyovnhfidGEUXBphDLb6Blxn3iJaMk1uZ1u8wRoAI3rgcWEQlmBjjiPlzHJSmcG8is3Nl7P/5LAjyP5Gz0Vw9ET5t+UtRcY23lZExaA5T0hFe7fE+2xcQ+3XhbAcWbw+b6oWZRFMEJfMg9Sg8PtuemjkeWph/YvvJe2NOYkqoFY9q/NS8DD2cm/GpP6M9CTrVDFItenfMp66L5+Z3Ez38lOspx6hctbmSd7OgsMLTC/+aFUxiEYAnoyUOnKLBT44eQjxdLmSEU+U0Po1IgRvlFxKQTvXzgYKT5oW75clcQpCB3RsMb/+iTe9ciZylJPg8i6gCcFHC+eg9KDwfwTe X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: b155f3d6-9b5f-4518-b5e0-08dcc699f492 X-MS-Exchange-CrossTenant-AuthSource: KL1PR0601MB4113.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Aug 2024 13:12:51.7307 (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: ASEGjlScHxJn6eSbWJGRwlI6oAfuWmBrpUlYgY64BWj7RPo/8GOmHtcb8slOvCah8juXkVKJZrNI2pYMxzLeDQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SEYPR06MB5916 When the original file is guaranteed to contain the minmax.h header file and compile correctly, using the real macro is usually more intuitive and readable. Signed-off-by: Yan Zhen --- Changes in v2: - Rewrite the subject. - Using max_t() instead of max(). drivers/spi/spi-nxp-fspi.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/spi/spi-nxp-fspi.c b/drivers/spi/spi-nxp-fspi.c index 88397f712a3b..fda902aa5815 100644 --- a/drivers/spi/spi-nxp-fspi.c +++ b/drivers/spi/spi-nxp-fspi.c @@ -756,8 +756,7 @@ static int nxp_fspi_read_ahb(struct nxp_fspi *f, const struct spi_mem_op *op) iounmap(f->ahb_addr); f->memmap_start = start; - f->memmap_len = len > NXP_FSPI_MIN_IOMAP ? - len : NXP_FSPI_MIN_IOMAP; + f->memmap_len = max_t(u32, len, NXP_FSPI_MIN_IOMAP); f->ahb_addr = ioremap(f->memmap_phy + f->memmap_start, f->memmap_len);