Message ID | 20240827075749.67583-1-shenlichuan@vivo.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D075EC5320E for <linux-arm-kernel@archiver.kernel.org>; Tue, 27 Aug 2024 07:59:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version:Content-Type: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=jGkuXpRPlbDxovSiLpJiHD6O9yWg/GjUCu3vXhWI4oE=; b=d71XdmXX6xAxVsqia/AhCBQ1a4 DZIBC6MrofgDJ55HlZJquJ+oaYmR8gJxmJriX+MQgVekSgmzF2vHBFLVrbsVXh76EQUl/iPSrOkIm LR6s622YcKCp8i1876XfWv0eOS3f1bhxGmqLLwCpscjEzmiE4AQuVnxMAx93PoWdEmgRP20DCCRnA 1OPHv4UYcXKsUDzJN0KIDy1SFttJbT4XJPsAJ36hayLVohNefOAlyzPiRkiwzApUap6KwCmWwPI3m 2HnKbcKuIxzn3WsBfEv/kJqHaI1qMB1+C3nWSe4jjIyuSCPnXqMFINmCbB29Y4lkamRfl/WYpkteI CjphHnCw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sir6X-0000000AJaN-2iQk; Tue, 27 Aug 2024 07:59:05 +0000 Received: from mail-psaapc01on2062f.outbound.protection.outlook.com ([2a01:111:f400:feae::62f] helo=APC01-PSA-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sir5j-0000000AJQI-0VQ0 for linux-arm-kernel@lists.infradead.org; Tue, 27 Aug 2024 07:58:16 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=R1WKzasL9/+Qh7pIR4+qpVnwkDrgwdPszy/C3IR/k7R44p2f75Bom0ZW3p8GrU1t9pNXXbLqpPimoaBPOSBKP7fAgwWyeeOpdzTgTrJ4Q+MUWV49Rp1mQb7G4fufQArgOm/4MRF9kw/6r0VRvQeViv2R4ujqCa6kAWN2k4tRz1v0CLyZdl/vV+q7A5aL0mrzPRkJun/2Y0+lPmR3ez/voiaQE7XdHELOwAtobG3oPTIW8rJcYDZbD0Lyy7XxtaClO/YfjJef90tZMJdjEqCsAYw7DewH55hNyMKx4QbC8uG6CHmTuVjpJkOC6VwFxqQ57E2ZmAlf47j4LVJ1PG3amg== 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=jGkuXpRPlbDxovSiLpJiHD6O9yWg/GjUCu3vXhWI4oE=; b=tnxg4DPxlAK7LKROVSf1KBAnPOR4/1JOr8SNOfxNBQ6n+unA6xZ6NgDB3MxRKuEm+eAH9+0A1miqu8vC7erospq0mQln5xGIgsK/xltckM3lun8t33vyMqyqof6o2iaG9C+EHKggjp5Ba1GJwYuln2AEvJdJyaylGIBIdg7KLwG7esD4B5qvvj8pae0c1sIQeMz1ON7QJEoTZ9AjgxNMWy7dalpdE9Uc09sESZ9/3U3k6DDWnSl7v6tygJM5lo43hZCMF9kLJw4bgzOPHfpVqW0jfYyu50Ud8gRfy8FTPe7yMwD3WBrCo+tVX9EA8ZwRyi4lJa5+FweKkx2i/EBaHQ== 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=jGkuXpRPlbDxovSiLpJiHD6O9yWg/GjUCu3vXhWI4oE=; b=gd3Px8NY2ysCoWhBag+yI3M31yJ6EvDhkfUcdtebIWCiII7a6bWpN5F0+4jE3lZC0KEf8q+G9pRcudqMc+b3FdCPbfNYnbLeZyw2hBeF1mQ38i4enfX1TUjZONb4DwBSfPgWUJsPo40wgrYm7pLugYPoVvoZDJSR7uqV2KRxvucy/a3NHFHtkseLnQI89gggQBVDA5nb6kB1if0yPT3kIgMzS4RrRTBDF0lHHZA62quZno+f5+XKRi78t3uEHRvSoLJXiKC1h0aMHH9ds68GXzo3P3kNTVgWFV2TEtf4K6Rcm3Pv8oS40kqdbeeMHZu1TRyOx3kt9NMf5qyc8In4jw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; Received: from SEZPR06MB5899.apcprd06.prod.outlook.com (2603:1096:101:e3::16) by KL1PR06MB5942.apcprd06.prod.outlook.com (2603:1096:820:de::7) 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 07:58:01 +0000 Received: from SEZPR06MB5899.apcprd06.prod.outlook.com ([fe80::8bfc:f1ee:8923:77ce]) by SEZPR06MB5899.apcprd06.prod.outlook.com ([fe80::8bfc:f1ee:8923:77ce%3]) with mapi id 15.20.7897.021; Tue, 27 Aug 2024 07:58:01 +0000 From: Shen Lichuan <shenlichuan@vivo.com> To: ukleinek@kernel.org, nicolas.ferre@microchip.com, alexandre.belloni@bootlin.com, claudiu.beznea@tuxon.dev Cc: linux-pwm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, opensource.kernel@vivo.com, Shen Lichuan <shenlichuan@vivo.com> Subject: [PATCH v1] pwm: atmel-tcb: Use min() macro Date: Tue, 27 Aug 2024 15:57:49 +0800 Message-Id: <20240827075749.67583-1-shenlichuan@vivo.com> X-Mailer: git-send-email 2.17.1 Content-Type: text/plain X-ClientProxiedBy: SG2PR01CA0147.apcprd01.prod.exchangelabs.com (2603:1096:4:8f::27) To SEZPR06MB5899.apcprd06.prod.outlook.com (2603:1096:101:e3::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SEZPR06MB5899:EE_|KL1PR06MB5942:EE_ X-MS-Office365-Filtering-Correlation-Id: fa66dad5-5bfb-46fa-23a1-08dcc66df8c1 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: W+FLR3WAVi5PKHm4sF+62jgqocV/sAMiRvaLiA1lGtrBvYn+OU/DrQVc1cWukmNRtnZsQpk7Dm2b1lAJ2rPbTXpQ81SPDJsYZmi0/XKb+xDCFVI3feSHcXxhqjEWJVfm2G1DmXpvqmDljqPNAgIm5T9r6/YHvYbzW1yAmLg9OYRg2bIPEafvUSHq8/C0Qk/6lNQpR2CIBVnIrEqjpWK78+LGRKcmnsGtzU+sw18m9hRyQK2f4Q+aAkemKp2VgMOzzUc7i7CrcxUnx4yLEp0MxRDFywredxm0bhYYRKWws6LTq8pl57QuNsP8OMXQAbu+iW1/UyqpnQRd4C/oJUI8V5D7s6X0j0hMzV2reukcQ+g/pUW33SzqBH8zVJLFHBXmbx5mj38r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.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SEZPR06MB5899.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(1800799024)(376014)(52116014)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: SU9qLxq7BfCoPgFzfDJvB3GBTNbShfoBfVjb6rW3xTpRjizTfG2V7MvajFK293Hy/9LOAvSU4y5fpYO6IW3wFb3wmAlL0NygUgPevXbgFAW1va5cqVR4zzwN7Z+lHo3vh7e0Qts7VauLOvo2xJYyrBw6HQQGAmN/s/BJtpBMWkkUuAyK0JsAM838T7m89n/PNiUho/aBWKRaWSbQGWSn76n6IkHS8IJrGtjUWSzTVitPTd9fMYacWjnZ/nsoQmTbHP7W9HEc7bj4QSlbgTAv0LEmJoOowEnu84Q+Ws06e6MQ/64hYTp6CYLkfyn8D0vGylHCSy0EQBaZcFsNEj2JE5QH/l2927P/0a7yIqePXSxpLjhGQSF1B2rLUPUQ15C2v5SSp3+7Lx7HuS7qJGFCAihM1et8CjvZiHsWH2OJyawT/H1THm3pvpr1QKBEBiYNopSVf3ptPzYhwCnVcLthbWVzdyyJUrRD6O558DTjU9lOQHMcaC6Z8pBCchBH5ylj2hh2MkArJhoIw2ca8xELpAPEb9upKbCX/6+eOhoHys5tam6jwFxIIqJFixYO8OGdjAuw/xiB+mL5INhBbPvHuC6ZiRZteqTP9G3i58O/JGYU4bm2uR87pOYANvG2PpzDdEsJMJeUXB9/J1409zTyoLv7wgPl8KRb7E57ZrE5t2qQ9nlD01b3usjeKpId4eXmRYyjyWr1Ywv7eNIkXNQ6xeOp3jBLajjJptkXbfgQJSgLyMPFtZn68seRUQVjgOrJCtksWocwjNByl8TPAhGj45XB0BYhMJlGru5czTS8YgGhF2f4aN0uNfxSg7GdVVSg6vkWDlnzdu/VinmP/9SKRC/s4zkXCLwsCqX3Ln1mcwZGdzmkNR70hl2ZYx0FFG8vUIQRvS/vSTPD0jzrCLEhNqDh7Ld7OJjgVTcl8IwXJL+y8LaBv43i0WysidiQZc8fukKHZjQwTDjmfb/Mlge/0dbY38l4YHwOWd/i4DwaFrEGvX6HveoY5I2i6MAAWUCbg6gXTyM9t8UTGFKj0gyabqEZtCDVZnSojBZOsOF9VkTp4PMNdZYdRjtC9NW2EzKBYUslP8zVEy1QEl45ujFnYExaRF1sKJwlPdtjahpesXF27uMdZGnNkv7ZwGceyoT2DTZ0ud/lncOCaoqADdu7wk00xXt7ZasTuQMvpbFJcaVMSA/Mx8+X+LNmxosO0mL/y0CXVENxzRs+z8doLJlfvMo6Nu7RMxFcQXW4oicAXCj40pXCmPjmzMyLjxOBF+G2MzTtgzAypfvrWY+PwEB/v9AK3m9Cgm1HaZ3Ct4ie24Kw9EoiCyeZDovslPPb8dt1tYsmqkq9LOtm0jq9uGrRG8yXmZ0/G9oHTZ7q/9DipFaXtrtccM1cKvntrMNIDb+MI+7C8/MtU50YHqMg/xPz/DxhhTYQ1U804yHdHXvxFRLBdrpwxMP3ON+1mDTbLbj66oSwR/o9WAecqbhXYIYR1SYC9nixxLlMTHd98PN192YuKfhsmcLIwAS5JZZ5DsvTJtgKBIu8tauDKpcjd4xMo6CdJvAUXPDsc4+RBk5pXszKCVWDNOJYtQZUOdtlTmzq X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-Network-Message-Id: fa66dad5-5bfb-46fa-23a1-08dcc66df8c1 X-MS-Exchange-CrossTenant-AuthSource: SEZPR06MB5899.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Aug 2024 07:58:00.9709 (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: +VqOHsE+w3qECxQ93yWQ70X34ekrMj2p2DyWCfIMye0OLLJ5mxaoXGdIgNyrKnEfyarNg45hpWBxwSosJgkIEg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: KL1PR06MB5942 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240827_005815_170201_11C477C1 X-CRM114-Status: UNSURE ( 9.05 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org |
Series |
[v1] pwm: atmel-tcb: Use min() macro
|
expand
|
Hello, On Tue, Aug 27, 2024 at 03:57:49PM +0800, Shen Lichuan wrote: > Use the min() macro to simplify the atmel_tcb_pwm_apply() function > and improve its readability. applied to https://git.kernel.org/pub/scm/linux/kernel/git/ukleinek/linux.git pwm/for-nexxt . As the merge window is currently open this will not go into next yet, but I'll schedule it for 6.13-rc1. Best regards and thanks for your contribution, Uwe
diff --git a/drivers/pwm/pwm-atmel-tcb.c b/drivers/pwm/pwm-atmel-tcb.c index f9a9c12cbcdd..386259eba9b3 100644 --- a/drivers/pwm/pwm-atmel-tcb.c +++ b/drivers/pwm/pwm-atmel-tcb.c @@ -342,8 +342,8 @@ static int atmel_tcb_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm, return 0; } - period = state->period < INT_MAX ? state->period : INT_MAX; - duty_cycle = state->duty_cycle < INT_MAX ? state->duty_cycle : INT_MAX; + period = min(state->period, INT_MAX); + duty_cycle = min(state->duty_cycle, INT_MAX); ret = atmel_tcb_pwm_config(chip, pwm, duty_cycle, period); if (ret)
Use the min() macro to simplify the atmel_tcb_pwm_apply() function and improve its readability. Signed-off-by: Shen Lichuan <shenlichuan@vivo.com> --- drivers/pwm/pwm-atmel-tcb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)