Received: by 2002:ac2:464d:0:0:0:0:0 with SMTP id s13csp3272755lfo; Mon, 23 May 2022 00:25:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx9SG8RFiU6hnK8TmZEcnN5HynqP/QmVDa0AtZDHZYBt+aCkGmvU2Cfnb3jnJtC6NB/unne X-Received: by 2002:a17:902:bb83:b0:161:fdc3:3b8f with SMTP id m3-20020a170902bb8300b00161fdc33b8fmr12320753pls.45.1653290713773; Mon, 23 May 2022 00:25:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1653290713; cv=pass; d=google.com; s=arc-20160816; b=qh1XzLfgjP8LACkdRrzm2tkQxhySZ4OmLi9FTwvqS/gH+52ZOh1/L/viguH4lFwO6X GsXU/H4xwL5vHhi3pc2oBo+KUSLj47KIXNMSRn0B7l8/VGQWO90KX/UNxJt46TDxBFI2 +T2waLANGRfVfg0E4Yo8jn/ZGmUggjWQdc0kDBXrnARSMmAfaRmHAcpDVuHomMEpefrJ /xZihyPhIl5qAFGBuy3wp3eCwh6v5e7fiWPjW1KRtZFLwWXB8++gaX1heLx9G/zJES2x tcFJzMsJ7RD2wrJkqj8OgfmkCNMQCDW6eCGdCECeNiDAlY4HoOVVslMTCbbAY0ZZxJKj /N+w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:user-agent:importance :content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:to:from:date:dkim-signature; bh=6Y3a2rgqTa+y/A+6b7ejIUWPHMPluHbYkwTV2tC9EVY=; b=VO1pclrPmqWAxWZ3OovmKJAxU/YHSsCDRkjAndVmUxPPDoPeDxmOR5Q9Q2ecoQWDDq 8Z7CjK68N2QSQSitjMnr3loDTFk1A4mID/R5zBWHcGr397V7sKcBr5ji7h5C+TWx0g1m sXYmL93C31U5j+Mnauht2VJ0ZFB42sADJTNK2pwzP/pAvui+H7BU2nP3j7ITAXUszSXA /U8/FVgep+gTtzudPITYZVZEinwpivGehe2NPKjdy+VnGPTB94lVDiGFuJpGWQzkz1P7 4SXMpXfMX9FH2+Dy303yCezUO+pSeTn43ArsrcGrnrQ/8CbpMb0G6/D8e5dgsBzK3rGX j/nw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@zohomail.com header.s=zm2022 header.b=dJYOf229; arc=pass (i=1 spf=pass spfdomain=zohomail.com dkim=pass dkdomain=zohomail.com dmarc=pass fromdomain=zohomail.com>); spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=zohomail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id j187-20020a638bc4000000b003f5d7f39d37si9447976pge.18.2022.05.23.00.25.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 00:25:13 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@zohomail.com header.s=zm2022 header.b=dJYOf229; arc=pass (i=1 spf=pass spfdomain=zohomail.com dkim=pass dkdomain=zohomail.com dmarc=pass fromdomain=zohomail.com>); spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=zohomail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3544BE2786; Sun, 22 May 2022 23:39:01 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355503AbiEWDce (ORCPT + 99 others); Sun, 22 May 2022 23:32:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351227AbiEWDcX (ORCPT ); Sun, 22 May 2022 23:32:23 -0400 Received: from sender4-pp-o94.zoho.com (sender4-pp-o94.zoho.com [136.143.188.94]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B696B31379; Sun, 22 May 2022 20:32:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653276566; cv=none; d=zohomail.com; s=zohoarc; b=fNNN4gVmX7g6l5sOV/P9Q23pxSFhqaZZfi5VJiiRtZufKZJoxf8WdvSyxbWIFFMPwveLnvDQ/1xYxfTlrGzEBLyMetQxhzNS6AvNoUa55v+2NZeubo/113VgWJYVyg0b/mkK8YCYj/QUpTZHiagMXn23nr5tgOjoLNp3ZFP2QE4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1653276566; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=6Y3a2rgqTa+y/A+6b7ejIUWPHMPluHbYkwTV2tC9EVY=; b=ZYr/jPoGzgtRWn00lq6uVruYbB0HwK6b0lzOVgkoDzVLXzwL2iht0ZEz2+5N08sZX7ICcnjvRs9U+eJEJ27wOfcuHModktOW2aEzcfEbKHyoHL8CMDI2LdjknypPd9GDJq/BX+KWK/8aXufNYNPgAyhQR7vkCujG2YSdY0N5BH8= 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=1653276566; 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=dJYOf229ttvDIQTleCtbfOB85CpuaxVkezkuOMMBEvSFe9TWxWUWUij3zXM3Q1WS SaWOQ2PLs63hN4PJ7bYRR2uMDc2/QzfGYfZxBxW3yKn1DIe+zb17T4fkylwH2EBZiGi l6qyYzOIN6dsEnGP+z6oK0IA5JJgs1IURiy2SVds= Received: from mail.zoho.com by mx.zohomail.com with SMTP id 1653276565914920.2020919127932; Sun, 22 May 2022 20:29:25 -0700 (PDT) Received: from [45.12.140.94] by mail.zoho.com with HTTP;Sun, 22 May 2022 20:29:25 -0700 (PDT) Date: Sun, 22 May 2022 20:29:25 -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: <180eef6617d.e8980cca60760.7125525107711306420@zohomail.com> In-Reply-To: <180eef39205.122d47c8260721.2430302798386025245@zohomail.com> References: <180e702a15f.e737e37e45859.3135149506136486394@zohomail.com> <180eef39205.122d47c8260721.2430302798386025245@zohomail.com> Subject: [PATCH v3 4/4] pinctrl: st: Switch to use regmap_field_test_bits 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: rr0801122656e5cd6958fd4c7ab94adfc500001fdd7fdaf26b00c40900fee6fcc267d0f5cc243561ae8014:zu08011227be15db908130756bfd6197d7000079ca5556e9ca4072f705e96ed88ba82c548fa4e0655aa79a18:rf0801122c6b0c60d1fae0235f510c60b60000e5ab222c1e075c932ea2810b9b23169e1ecd448bf137269266dd888fceb0:ZohoMail X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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