From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from sender4-pp-o94.zoho.com (sender4-pp-o94.zoho.com [136.143.188.94]) (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 A760D36E for ; Mon, 23 May 2022 02:28:00 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; t=1653272743; cv=none; d=zohomail.com; s=zohoarc; b=Em3CyMziUfMyb2Ke9Rew/25b8PL2RUI8784W3WiQQoHcIGyZJ51udjwu34XDe/Cynhyps9AJiVgNDRHzn5n19A4a44QR8C1677XQ67+aKHoIp1xQFKJm0pYtzQ9jewhVV1z+/xS+tRoxK9VNjBEckN+HsMueezsXJH2lvcmuZS0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1653272743; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=6Y3a2rgqTa+y/A+6b7ejIUWPHMPluHbYkwTV2tC9EVY=; b=b7m17VbiyHdoSowcQN1KFKUO+BrO2mfhGUEABGvvIZOCWqLwxUUFsLmVxNd83IFuZpPmgrdCCYVxmb4zygwfzcMO89lKWIznsikIjoQ0TN03f7MOd0yalb7FvP5CQVHOwXyv9Dls3WGVkpTqNH/QEtw3qHihPZIP84r2Q3y7R54= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=zohomail.com; spf=pass smtp.mailfrom=lchen.firstlove@zohomail.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1653272743; s=zm2022; d=zohomail.com; i=lchen.firstlove@zohomail.com; h=Date:Date:From:From:To:To:Message-ID:In-Reply-To:References:Subject:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding:Feedback-ID:Message-Id:Reply-To:Cc; bh=6Y3a2rgqTa+y/A+6b7ejIUWPHMPluHbYkwTV2tC9EVY=; b=cmegWyj21gvIXeJVQ4Im3h7WUkoR2+szgtmOW/llh/xtwXJi5/vkNWCXp8bhQm/p q7rES8QIdXzpS6+y/EtnZTHzV3iz8pe7qfhFEpLqZVm7kQRft9gIzRunB+gfrh/U49J +HPPLuaRVMJ5jEjCqDV5ZDUUOqTomxpXG2xVmsjY= Received: from mail.zoho.com by mx.zohomail.com with SMTP id 165327274252945.40475680553243; Sun, 22 May 2022 19:25:42 -0700 (PDT) Received: from [45.12.140.94] by mail.zoho.com with HTTP;Sun, 22 May 2022 19:25:42 -0700 (PDT) Date: Sun, 22 May 2022 19:25:42 -0700 From: Li Chen To: "Mark Brown" , "linux-kernel" , "Greg Kroah-Hartman" , "Rafael J. Wysocki" , "linux-gpio" , "Linus Walleij" , "linux-arm-kernel" , "Patrice Chotard" , "linux-sunxi" , "Liam Girdwood" , "Jaroslav Kysela" , "Takashi Iwai" , "Chen-Yu Tsai" , "Jernej Skrabec" , "Samuel Holland" , "Philipp Zabel" Message-ID: <180eebc0a68.1213567e360188.4128572766389616428@zohomail.com> In-Reply-To: <180eeb93909.12110e2de60158.391061173597432851@zohomail.com> References: <180e702a15f.e737e37e45859.3135149506136486394@zohomail.com> <180eeb93909.12110e2de60158.391061173597432851@zohomail.com> Subject: [PATCH v2 4/4] pinctrl: st: Switch to use regmap_field_test_bits Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Importance: Medium User-Agent: Zoho Mail X-Mailer: Zoho Mail Feedback-ID: rr08011226c81fff77cfb172051bb436070000ef21e1d993c2a55c01ff1bade2a6d546b94b3ff9d69998ce:zu080112271e839f8acf638f74714b99d20000340fa72a3f103abecd542078fe39e42ef0f758ace926067986:rf0801122cba061c57510890781b2afc5f00005905e73cb464f94c463b10decb0ec92d506f90932586c1790432f98ded57:ZohoMail From: Li Chen Appropriately change calls to regmap_field_read() with regmap_field_test_bits() for improved readability. Reported-by: kernel test robot Signed-off-by: Li Chen --- drivers/pinctrl/pinctrl-st.c | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/drivers/pinctrl/pinctrl-st.c b/drivers/pinctrl/pinctrl-st.c index 0fea71fd9a00..198b4a9d263b 100644 --- a/drivers/pinctrl/pinctrl-st.c +++ b/drivers/pinctrl/pinctrl-st.c @@ -573,23 +573,18 @@ static void st_pinconf_set_retime_dedicated(struct st_pinctrl *info, static void st_pinconf_get_direction(struct st_pio_control *pc, int pin, unsigned long *config) { - unsigned int oe_value, pu_value, od_value; - if (pc->oe) { - regmap_field_read(pc->oe, &oe_value); - if (oe_value & BIT(pin)) + if (regmap_field_test_bits(pc->oe, BIT(pin))) ST_PINCONF_PACK_OE(*config); } if (pc->pu) { - regmap_field_read(pc->pu, &pu_value); - if (pu_value & BIT(pin)) + if (regmap_field_test_bits(pc->pu, BIT(pin))) ST_PINCONF_PACK_PU(*config); } if (pc->od) { - regmap_field_read(pc->od, &od_value); - if (od_value & BIT(pin)) + if (regmap_field_test_bits(pc->od, BIT(pin))) ST_PINCONF_PACK_OD(*config); } } @@ -599,22 +594,22 @@ static int st_pinconf_get_retime_packed(struct st_pinctrl *info, { const struct st_pctl_data *data = info->data; struct st_retime_packed *rt_p = &pc->rt.rt_p; - unsigned int delay_bits, delay, delay0, delay1, val; + unsigned int delay_bits, delay, delay0, delay1; int output = ST_PINCONF_UNPACK_OE(*config); - if (!regmap_field_read(rt_p->retime, &val) && (val & BIT(pin))) + if (!regmap_field_test_bits(rt_p->retime, BIT(pin))) ST_PINCONF_PACK_RT(*config); - if (!regmap_field_read(rt_p->clk1notclk0, &val) && (val & BIT(pin))) + if (!regmap_field_test_bits(rt_p->clk1notclk0, BIT(pin))) ST_PINCONF_PACK_RT_CLK(*config, 1); - if (!regmap_field_read(rt_p->clknotdata, &val) && (val & BIT(pin))) + if (!regmap_field_test_bits(rt_p->clknotdata, BIT(pin))) ST_PINCONF_PACK_RT_CLKNOTDATA(*config); - if (!regmap_field_read(rt_p->double_edge, &val) && (val & BIT(pin))) + if (!regmap_field_test_bits(rt_p->double_edge, BIT(pin))) ST_PINCONF_PACK_RT_DOUBLE_EDGE(*config); - if (!regmap_field_read(rt_p->invertclk, &val) && (val & BIT(pin))) + if (!regmap_field_test_bits(rt_p->invertclk, BIT(pin))) ST_PINCONF_PACK_RT_INVERTCLK(*config); regmap_field_read(rt_p->delay_0, &delay0); -- 2.36.1 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 BE834C433EF for ; Mon, 23 May 2022 08:16:44 +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-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Subject:References: In-Reply-To:Message-ID:To:From:Date:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=KyCBlI/JeJHdHl/6E5PUgs6GjsVhYTyJE2OmOlSj/qE=; b=R/wtNftL7MOdJw2AUHNGh7H95d e/5DPYjLm4EOrGZNH/61kMulNe1ZS/FhArt3rnrw9xwsgVSKdZRz5q8OMl8LOvthkOamBCzYVR1Wl MV6ezcA5p7MbJYeubA6OidnOhZuc+sryvCJLkowYJh6hJtxQOkrv/QGoZwWXAEV5gV9EylCJFljha WdrMvdrudK0pzio7OatLVwsQrm6CAvm++B1YZs0ggbG5y8dXsQCsdaqYIkGE1S70kvtgvUBbYa16s 6ui12seTkPwFI+EhA85uYIZ5PRFS57avEhoOOuans6tHfiB7Cpv3hiKECRY71dxFDSn2/a0tefMDT 1XxKGt4Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nt3Db-002Lqd-QQ; Mon, 23 May 2022 08:15:13 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nt2sa-002CKb-Fh for linux-arm-kernel@bombadil.infradead.org; Mon, 23 May 2022 07:53:28 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:Content-Type :MIME-Version:Subject:References:In-Reply-To:Message-ID:To:From:Date:Sender: Reply-To:Cc:Content-ID:Content-Description; bh=6Y3a2rgqTa+y/A+6b7ejIUWPHMPluHbYkwTV2tC9EVY=; b=U62RBM7am2chX5FJHE1Zo/5wgc +hswz8TMMezbZ65MMph10EB166y2OJNgQY4HJanuaPOiRbTFIxpANI6hw4PDElYM05AoUdISLLp7v wojqhVbLcysFNsKZpVyoZ7JjqJa9nPaTuWSH56HAIfxaUlqvAA7nX7/1D/l8GMF2yara20zbrEGZk gjNParhNlma+e3fji6w2QMbZYQmK0kGp6nKfZGJHKA4B7ApEg2Q293qbjd5ZZ+NGklfH1gMIXS4aI zewsvgihrkhhwU13GtXquLhTc/HoQamLaV0wnEqgBy/GS669qADU0te66auje1PKmWpXMoD8P9roC G1qtlicg==; Received: from sender4-pp-o94.zoho.com ([136.143.188.94]) by desiato.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nsxnX-000lPp-7y for linux-arm-kernel@lists.infradead.org; Mon, 23 May 2022 02:27:59 +0000 ARC-Seal: i=1; a=rsa-sha256; t=1653272743; cv=none; d=zohomail.com; s=zohoarc; b=Em3CyMziUfMyb2Ke9Rew/25b8PL2RUI8784W3WiQQoHcIGyZJ51udjwu34XDe/Cynhyps9AJiVgNDRHzn5n19A4a44QR8C1677XQ67+aKHoIp1xQFKJm0pYtzQ9jewhVV1z+/xS+tRoxK9VNjBEckN+HsMueezsXJH2lvcmuZS0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1653272743; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=6Y3a2rgqTa+y/A+6b7ejIUWPHMPluHbYkwTV2tC9EVY=; b=b7m17VbiyHdoSowcQN1KFKUO+BrO2mfhGUEABGvvIZOCWqLwxUUFsLmVxNd83IFuZpPmgrdCCYVxmb4zygwfzcMO89lKWIznsikIjoQ0TN03f7MOd0yalb7FvP5CQVHOwXyv9Dls3WGVkpTqNH/QEtw3qHihPZIP84r2Q3y7R54= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=zohomail.com; spf=pass smtp.mailfrom=lchen.firstlove@zohomail.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1653272743; s=zm2022; d=zohomail.com; i=lchen.firstlove@zohomail.com; h=Date:Date:From:From:To:To:Message-ID:In-Reply-To:References:Subject:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding:Feedback-ID:Message-Id:Reply-To:Cc; bh=6Y3a2rgqTa+y/A+6b7ejIUWPHMPluHbYkwTV2tC9EVY=; b=cmegWyj21gvIXeJVQ4Im3h7WUkoR2+szgtmOW/llh/xtwXJi5/vkNWCXp8bhQm/p q7rES8QIdXzpS6+y/EtnZTHzV3iz8pe7qfhFEpLqZVm7kQRft9gIzRunB+gfrh/U49J +HPPLuaRVMJ5jEjCqDV5ZDUUOqTomxpXG2xVmsjY= Received: from mail.zoho.com by mx.zohomail.com with SMTP id 165327274252945.40475680553243; Sun, 22 May 2022 19:25:42 -0700 (PDT) Received: from [45.12.140.94] by mail.zoho.com with HTTP;Sun, 22 May 2022 19:25:42 -0700 (PDT) Date: Sun, 22 May 2022 19:25:42 -0700 From: Li Chen To: "Mark Brown" , "linux-kernel" , "Greg Kroah-Hartman" , "Rafael J. Wysocki" , "linux-gpio" , "Linus Walleij" , "linux-arm-kernel" , "Patrice Chotard" , "linux-sunxi" , "Liam Girdwood" , "Jaroslav Kysela" , "Takashi Iwai" , "Chen-Yu Tsai" , "Jernej Skrabec" , "Samuel Holland" , "Philipp Zabel" Message-ID: <180eebc0a68.1213567e360188.4128572766389616428@zohomail.com> In-Reply-To: <180eeb93909.12110e2de60158.391061173597432851@zohomail.com> References: <180e702a15f.e737e37e45859.3135149506136486394@zohomail.com> <180eeb93909.12110e2de60158.391061173597432851@zohomail.com> Subject: [PATCH v2 4/4] pinctrl: st: Switch to use regmap_field_test_bits MIME-Version: 1.0 Importance: Medium User-Agent: Zoho Mail X-Mailer: Zoho Mail Feedback-ID: rr08011226c81fff77cfb172051bb436070000ef21e1d993c2a55c01ff1bade2a6d546b94b3ff9d69998ce:zu080112271e839f8acf638f74714b99d20000340fa72a3f103abecd542078fe39e42ef0f758ace926067986:rf0801122cba061c57510890781b2afc5f00005905e73cb464f94c463b10decb0ec92d506f90932586c1790432f98ded57:ZohoMail X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220523_032758_293325_603E6BC7 X-CRM114-Status: GOOD ( 13.45 ) 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: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Li Chen Appropriately change calls to regmap_field_read() with regmap_field_test_bits() for improved readability. Reported-by: kernel test robot Signed-off-by: Li Chen --- drivers/pinctrl/pinctrl-st.c | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/drivers/pinctrl/pinctrl-st.c b/drivers/pinctrl/pinctrl-st.c index 0fea71fd9a00..198b4a9d263b 100644 --- a/drivers/pinctrl/pinctrl-st.c +++ b/drivers/pinctrl/pinctrl-st.c @@ -573,23 +573,18 @@ static void st_pinconf_set_retime_dedicated(struct st_pinctrl *info, static void st_pinconf_get_direction(struct st_pio_control *pc, int pin, unsigned long *config) { - unsigned int oe_value, pu_value, od_value; - if (pc->oe) { - regmap_field_read(pc->oe, &oe_value); - if (oe_value & BIT(pin)) + if (regmap_field_test_bits(pc->oe, BIT(pin))) ST_PINCONF_PACK_OE(*config); } if (pc->pu) { - regmap_field_read(pc->pu, &pu_value); - if (pu_value & BIT(pin)) + if (regmap_field_test_bits(pc->pu, BIT(pin))) ST_PINCONF_PACK_PU(*config); } if (pc->od) { - regmap_field_read(pc->od, &od_value); - if (od_value & BIT(pin)) + if (regmap_field_test_bits(pc->od, BIT(pin))) ST_PINCONF_PACK_OD(*config); } } @@ -599,22 +594,22 @@ static int st_pinconf_get_retime_packed(struct st_pinctrl *info, { const struct st_pctl_data *data = info->data; struct st_retime_packed *rt_p = &pc->rt.rt_p; - unsigned int delay_bits, delay, delay0, delay1, val; + unsigned int delay_bits, delay, delay0, delay1; int output = ST_PINCONF_UNPACK_OE(*config); - if (!regmap_field_read(rt_p->retime, &val) && (val & BIT(pin))) + if (!regmap_field_test_bits(rt_p->retime, BIT(pin))) ST_PINCONF_PACK_RT(*config); - if (!regmap_field_read(rt_p->clk1notclk0, &val) && (val & BIT(pin))) + if (!regmap_field_test_bits(rt_p->clk1notclk0, BIT(pin))) ST_PINCONF_PACK_RT_CLK(*config, 1); - if (!regmap_field_read(rt_p->clknotdata, &val) && (val & BIT(pin))) + if (!regmap_field_test_bits(rt_p->clknotdata, BIT(pin))) ST_PINCONF_PACK_RT_CLKNOTDATA(*config); - if (!regmap_field_read(rt_p->double_edge, &val) && (val & BIT(pin))) + if (!regmap_field_test_bits(rt_p->double_edge, BIT(pin))) ST_PINCONF_PACK_RT_DOUBLE_EDGE(*config); - if (!regmap_field_read(rt_p->invertclk, &val) && (val & BIT(pin))) + if (!regmap_field_test_bits(rt_p->invertclk, BIT(pin))) ST_PINCONF_PACK_RT_INVERTCLK(*config); regmap_field_read(rt_p->delay_0, &delay0); -- 2.36.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel