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 610DCC4332F for ; Fri, 2 Dec 2022 17:57:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233959AbiLBR53 (ORCPT ); Fri, 2 Dec 2022 12:57:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234370AbiLBR5V (ORCPT ); Fri, 2 Dec 2022 12:57:21 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7BDBFE61DF for ; Fri, 2 Dec 2022 09:57:20 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p1AHk-0003dK-AZ; Fri, 02 Dec 2022 18:57:16 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1p1AHh-001qqf-Ln; Fri, 02 Dec 2022 18:57:14 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1p1AHg-0025zX-W2; Fri, 02 Dec 2022 18:57:13 +0100 Date: Fri, 2 Dec 2022 18:57:12 +0100 From: Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= To: Fabrice Gasnier Cc: Thierry Reding , Maxime Coquelin , Alexandre Torgue , kernel@pengutronix.de, linux-pwm@vger.kernel.org, Mark Brown , linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 4/5] pwm: stm32-lp: Use regmap_clear_bits and regmap_set_bits where applicable Message-ID: <20221202175712.tz6uwalr6d46r2ad@pengutronix.de> References: <20221115111347.3705732-1-u.kleine-koenig@pengutronix.de> <20221115111347.3705732-5-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="dnx7n762zixpg7wt" Content-Disposition: inline In-Reply-To: X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-pwm@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pwm@vger.kernel.org --dnx7n762zixpg7wt Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Nov 23, 2022 at 11:23:14AM +0100, Fabrice Gasnier wrote: > On 11/15/22 12:13, Uwe Kleine-K=F6nig wrote: > > Found using coccinelle and the following semantic patch: > >=20 > > @@ > > expression map, reg, bits; > > @@ > >=20 > > - regmap_update_bits(map, reg, bits, bits) > > + regmap_set_bits(map, reg, bits) > >=20 > > @@ > > expression map, reg, bits; > > @@ > >=20 > > - regmap_update_bits(map, reg, bits, 0) > > + regmap_clear_bits(map, reg, bits) > >=20 > > Signed-off-by: Uwe Kleine-K=F6nig > > --- > > drivers/pwm/pwm-stm32-lp.c | 5 ++--- > > 1 file changed, 2 insertions(+), 3 deletions(-) > >=20 > > diff --git a/drivers/pwm/pwm-stm32-lp.c b/drivers/pwm/pwm-stm32-lp.c > > index 3115abb3f52a..212bdc7d51ee 100644 > > --- a/drivers/pwm/pwm-stm32-lp.c > > +++ b/drivers/pwm/pwm-stm32-lp.c > > @@ -140,9 +140,8 @@ static int stm32_pwm_lp_apply(struct pwm_chip *chip= , struct pwm_device *pwm, > > =20 > > if (reenable) { > > /* Start LP timer in continuous mode */ > > - ret =3D regmap_update_bits(priv->regmap, STM32_LPTIM_CR, > > - STM32_LPTIM_CNTSTRT, > > - STM32_LPTIM_CNTSTRT); > > + ret =3D regmap_set_bits(priv->regmap, STM32_LPTIM_CR, > > + STM32_LPTIM_CNTSTRT); >=20 > Hi Uwe, >=20 > One minor suggestion here: could fit into a single line. That would make the line 89 chars long (counting tag as usual as 8). Up to now there is no line longer than 78 chars. So I'd not join the two lines. Best regards Uwe --=20 Pengutronix e.K. | Uwe Kleine-K=F6nig | Industrial Linux Solutions | https://www.pengutronix.de/ | --dnx7n762zixpg7wt Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEfnIqFpAYrP8+dKQLwfwUeK3K7AkFAmOKPHUACgkQwfwUeK3K 7AkThQf/azjMPUOcji5c6MwxyjUEpcAH+50ie5NEeDZGr3m9Cr/AMBErl9F15Yyu yfmo4A/szg/Yn71jvCgRBY45yWImxAGPV4zW9UMK9vdh3skZuvqstmk8GRRDTtV3 0bHKIpvAuk1D7TqrA4sPVc05RkizDpDX0+CN97fDoZkFhBWSKCsz8bFRaBy1/6BH UbydfZnnnza7qlem4O8Ux3iZqHBqETJfz1GHVOA8oP5akCYhHAH5CEimdXrDlHXM netetHku4Sy64xsdICXmGb75Ey4/J+nbs7LoIwP7fXV2YnkuwYi+w0uR3Gs3kYuz VoIVur7FA41pAqJznPx20g89ufZb+w== =gDKC -----END PGP SIGNATURE----- --dnx7n762zixpg7wt-- 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 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 E366FC4332F for ; Fri, 2 Dec 2022 17:58:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=EFE0vGvKE1jBo/IUUZbWgiOQZlwqmf9ROgslX2U/Cto=; b=k45zik/fviolXbNTnD9U6BVlsk tXeFYGOr6AaxaUNlFd9o/XFvtxm7vlykHQC4YgSx0U64BN6LgJa8a2jYhkraCO9h3qR1xAg7PJchv bVG//4Ak+/W8WMzSktnxyY6545uHr7WXdPaecfQPyN51lpoxWOPyCTQ7aeoR8ZPotWkNavatl4ipw 84lMpO8+DrQrN822vZXkejCQneFm2OUIrRyFXXL5YM4QYZe6Y/7Qn0eco39aYuBKa0iZoCW9Emg+x 8hGl9nZ103+HVraksstMpjn5xnaeSquq6ICMIfL4kMyWBGKMHj6g0tgSQE7n3+aGOM4jFp57figVj kl3jXVXg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p1AI0-000TuU-3I; Fri, 02 Dec 2022 17:57:32 +0000 Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p1AHw-000Tqg-Dp for linux-arm-kernel@lists.infradead.org; Fri, 02 Dec 2022 17:57:30 +0000 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p1AHk-0003dK-AZ; Fri, 02 Dec 2022 18:57:16 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1p1AHh-001qqf-Ln; Fri, 02 Dec 2022 18:57:14 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1p1AHg-0025zX-W2; Fri, 02 Dec 2022 18:57:13 +0100 Date: Fri, 2 Dec 2022 18:57:12 +0100 From: Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= To: Fabrice Gasnier Cc: Thierry Reding , Maxime Coquelin , Alexandre Torgue , kernel@pengutronix.de, linux-pwm@vger.kernel.org, Mark Brown , linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH 4/5] pwm: stm32-lp: Use regmap_clear_bits and regmap_set_bits where applicable Message-ID: <20221202175712.tz6uwalr6d46r2ad@pengutronix.de> References: <20221115111347.3705732-1-u.kleine-koenig@pengutronix.de> <20221115111347.3705732-5-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 In-Reply-To: X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-arm-kernel@lists.infradead.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221202_095728_492132_D284E236 X-CRM114-Status: GOOD ( 22.66 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============4837523969556922019==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============4837523969556922019== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="dnx7n762zixpg7wt" Content-Disposition: inline --dnx7n762zixpg7wt Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Nov 23, 2022 at 11:23:14AM +0100, Fabrice Gasnier wrote: > On 11/15/22 12:13, Uwe Kleine-K=F6nig wrote: > > Found using coccinelle and the following semantic patch: > >=20 > > @@ > > expression map, reg, bits; > > @@ > >=20 > > - regmap_update_bits(map, reg, bits, bits) > > + regmap_set_bits(map, reg, bits) > >=20 > > @@ > > expression map, reg, bits; > > @@ > >=20 > > - regmap_update_bits(map, reg, bits, 0) > > + regmap_clear_bits(map, reg, bits) > >=20 > > Signed-off-by: Uwe Kleine-K=F6nig > > --- > > drivers/pwm/pwm-stm32-lp.c | 5 ++--- > > 1 file changed, 2 insertions(+), 3 deletions(-) > >=20 > > diff --git a/drivers/pwm/pwm-stm32-lp.c b/drivers/pwm/pwm-stm32-lp.c > > index 3115abb3f52a..212bdc7d51ee 100644 > > --- a/drivers/pwm/pwm-stm32-lp.c > > +++ b/drivers/pwm/pwm-stm32-lp.c > > @@ -140,9 +140,8 @@ static int stm32_pwm_lp_apply(struct pwm_chip *chip= , struct pwm_device *pwm, > > =20 > > if (reenable) { > > /* Start LP timer in continuous mode */ > > - ret =3D regmap_update_bits(priv->regmap, STM32_LPTIM_CR, > > - STM32_LPTIM_CNTSTRT, > > - STM32_LPTIM_CNTSTRT); > > + ret =3D regmap_set_bits(priv->regmap, STM32_LPTIM_CR, > > + STM32_LPTIM_CNTSTRT); >=20 > Hi Uwe, >=20 > One minor suggestion here: could fit into a single line. That would make the line 89 chars long (counting tag as usual as 8). Up to now there is no line longer than 78 chars. So I'd not join the two lines. Best regards Uwe --=20 Pengutronix e.K. | Uwe Kleine-K=F6nig | Industrial Linux Solutions | https://www.pengutronix.de/ | --dnx7n762zixpg7wt Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEfnIqFpAYrP8+dKQLwfwUeK3K7AkFAmOKPHUACgkQwfwUeK3K 7AkThQf/azjMPUOcji5c6MwxyjUEpcAH+50ie5NEeDZGr3m9Cr/AMBErl9F15Yyu yfmo4A/szg/Yn71jvCgRBY45yWImxAGPV4zW9UMK9vdh3skZuvqstmk8GRRDTtV3 0bHKIpvAuk1D7TqrA4sPVc05RkizDpDX0+CN97fDoZkFhBWSKCsz8bFRaBy1/6BH UbydfZnnnza7qlem4O8Ux3iZqHBqETJfz1GHVOA8oP5akCYhHAH5CEimdXrDlHXM netetHku4Sy64xsdICXmGb75Ey4/J+nbs7LoIwP7fXV2YnkuwYi+w0uR3Gs3kYuz VoIVur7FA41pAqJznPx20g89ufZb+w== =gDKC -----END PGP SIGNATURE----- --dnx7n762zixpg7wt-- --===============4837523969556922019== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============4837523969556922019==--