From patchwork Fri Jun 16 20:33:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raag Jadav X-Patchwork-Id: 109363 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp1604292vqr; Fri, 16 Jun 2023 13:43:42 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5p3Fx7jP4bU13eVXPeuB7mQ9DnXP4FtybRKvXELOANBX8HraOcEl3YYWSrFHXZvgFO5ULs X-Received: by 2002:a05:6a00:1913:b0:63d:3981:313d with SMTP id y19-20020a056a00191300b0063d3981313dmr3516902pfi.10.1686948222032; Fri, 16 Jun 2023 13:43:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686948222; cv=none; d=google.com; s=arc-20160816; b=eP8JeDLCIvB1seuY1mdOZk1NtMu5NreycMlgJmYVqQoHPm+YLZBBZB/a8H9fRfkPqO 4hAFf5SZklLO+Mlf+UjxxMi8hhajsi0w1ik94jD0Rk3XoSe3bavCiFOx8dfP76EnVtOA tGUUgh69I7DVwQOtmRpGc3Bqe1BKH6cdJRZ4vXlqVGdnZkVPHY3oOYm7T/+PykXBWpVr PS7Ev2USrpWuIq+CmVjtb3/WxA7vHgJMBK295kAlR9WLaNzRtUV9ku+Lu7REPAYnBzR1 8m/oHcFJhGkuY6ZP277yLvM2y25LyOiPQZpi4aOi++sdUhUYPRmuhaIC0wNMPvnlSBDv VMvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=nNVcYQFfC5y6ZaF+otitU3MfSQUPy/WPJSu0ikxWjpk=; b=qUFNBjK+ybdqhLkhtoFnJhLW2tYRy7Mv4ocIb1KEX4SyneEsSbQf/l+GR7DWQ13klI apiBGXWPRIq44/DmTlCNTUI9YLMQ3/mdthl83xFcLMDilEyrVn8wnGBm8iP2QjomV1W+ vQJL0iVGfIPpts4fjxZnglIWgTPizaso9/O4OA+6nADbA+WII4NHq+8hMSUtgP+XbuyT ZnsOryLVQZS8T1SxvKCd3QLPCqVgV8oKfWC7zJp5JoQO9fTmRBTOWqZtTR0prYlPKA7W CdJ6z2vdzYZOELXTvxVXa6+DK4g8HpBWwOnSo2pT37UYAiATs0RNJt+dgGzWuuy4GM2/ ANBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=CmIUOiAx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p9-20020a639509000000b00544538e2041si17285689pgd.305.2023.06.16.13.43.29; Fri, 16 Jun 2023 13:43:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=CmIUOiAx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230327AbjFPUfS (ORCPT + 99 others); Fri, 16 Jun 2023 16:35:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55386 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234169AbjFPUey (ORCPT ); Fri, 16 Jun 2023 16:34:54 -0400 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 76D513A9D; Fri, 16 Jun 2023 13:34:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1686947693; x=1718483693; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=0Nx2tcrNyouaIATaj8ZYKNJsnZ50pb885XPfiz8v0YY=; b=CmIUOiAxtG2HcnFEAZd5AybuBQGxXB75Gwbs2c8jZGTLzwnDSQ5YdyHb k7NjCsX5ozLYxJq9d8zM57JdLtVhw9ogpytNFgeXh+qhRLVVn5G1Kji+/ dHftGGYyHaZrIK5mu4OKpEKd2A/g6EhOabnvLdlugk1HxSKmaFPPzBXiP PFE/y35CRbI/0iua0pglmk00Nrqjucys6AVqXzqzUntbVHbwhL/qNjPj6 CPXofaPZmYGmRWqyUjUxsFIxRAb7nXMHUtJBVVRuVQSpnqGFh09Y1RFWi 13ijtQJTlqxUfOoE8Dl3qXnMY38hRY7x8Mp9EvzQIgj8BVKWJyki4ASsa A==; X-IronPort-AV: E=McAfee;i="6600,9927,10743"; a="358181774" X-IronPort-AV: E=Sophos;i="6.00,248,1681196400"; d="scan'208";a="358181774" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jun 2023 13:34:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10743"; a="802964395" X-IronPort-AV: E=Sophos;i="6.00,248,1681196400"; d="scan'208";a="802964395" Received: from inesxmail01.iind.intel.com ([10.223.154.20]) by FMSMGA003.fm.intel.com with ESMTP; 16 Jun 2023 13:34:50 -0700 Received: from inlubt0316.iind.intel.com (inlubt0316.iind.intel.com [10.191.20.213]) by inesxmail01.iind.intel.com (Postfix) with ESMTP id 52262911E8; Sat, 17 Jun 2023 02:04:49 +0530 (IST) Received: by inlubt0316.iind.intel.com (Postfix, from userid 12101951) id 4C53819B; Sat, 17 Jun 2023 02:04:49 +0530 (IST) From: Raag Jadav To: linus.walleij@linaro.org, mika.westerberg@linux.intel.com, andriy.shevchenko@linux.intel.com Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, mallikarjunappa.sangannavar@intel.com, pandith.n@intel.com, Raag Jadav Subject: [PATCH for-next v1 1/3] pinctrl: baytrail: reduce scope of spinlock in ->dbg_show() hook Date: Sat, 17 Jun 2023 02:03:54 +0530 Message-Id: <20230616203356.27343-2-raag.jadav@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230616203356.27343-1-raag.jadav@intel.com> References: <20230616203356.27343-1-raag.jadav@intel.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768893419069313257?= X-GMAIL-MSGID: =?utf-8?q?1768893419069313257?= Reduce scope of spinlock to IO operations in ->dbg_show() hook and save a few bytes. add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-12 (-12) Function old new delta byt_gpio_dbg_show 890 878 -12 Total: Before=17029, After=17017, chg -0.07% Signed-off-by: Raag Jadav --- drivers/pinctrl/intel/pinctrl-baytrail.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/pinctrl/intel/pinctrl-baytrail.c b/drivers/pinctrl/intel/pinctrl-baytrail.c index d53952f5c87c..54d3c5c26944 100644 --- a/drivers/pinctrl/intel/pinctrl-baytrail.c +++ b/drivers/pinctrl/intel/pinctrl-baytrail.c @@ -1241,30 +1241,30 @@ static void byt_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip) for (i = 0; i < vg->soc->npins; i++) { const struct intel_community *comm; + void __iomem *conf_reg, *val_reg; const char *pull_str = NULL; const char *pull = NULL; - void __iomem *reg; unsigned long flags; const char *label; unsigned int pin; - raw_spin_lock_irqsave(&byt_lock, flags); pin = vg->soc->pins[i].number; - reg = byt_gpio_reg(vg, pin, BYT_CONF0_REG); - if (!reg) { + + conf_reg = byt_gpio_reg(vg, pin, BYT_CONF0_REG); + if (!conf_reg) { seq_printf(s, "Pin %i: can't retrieve CONF0\n", pin); - raw_spin_unlock_irqrestore(&byt_lock, flags); continue; } - conf0 = readl(reg); - reg = byt_gpio_reg(vg, pin, BYT_VAL_REG); - if (!reg) { + val_reg = byt_gpio_reg(vg, pin, BYT_VAL_REG); + if (!val_reg) { seq_printf(s, "Pin %i: can't retrieve VAL\n", pin); - raw_spin_unlock_irqrestore(&byt_lock, flags); continue; } - val = readl(reg); + + raw_spin_lock_irqsave(&byt_lock, flags); + conf0 = readl(conf_reg); + val = readl(val_reg); raw_spin_unlock_irqrestore(&byt_lock, flags); comm = byt_get_community(vg, pin); From patchwork Fri Jun 16 20:33:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raag Jadav X-Patchwork-Id: 109362 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp1604215vqr; Fri, 16 Jun 2023 13:43:33 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5xqEYbQmfv7FjVYshjuyZOEBYltyWW6AOOKjMWYjuXXMPEHTScAPq60NYzptHdRnLAH6WN X-Received: by 2002:a17:90a:1908:b0:256:5dec:50ed with SMTP id 8-20020a17090a190800b002565dec50edmr2513685pjg.7.1686948213401; Fri, 16 Jun 2023 13:43:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686948213; cv=none; d=google.com; s=arc-20160816; b=gAtLlwBIVwiC9iIlCdxBL8RytPojjruze4HXIWKDG3Qk96g6XWUV0jyZu6LjdKidGB JzY2rqpXLp7XsFGOFLLSIfi+wAhfTLAyI3lF3IidZJqJH0UoS0qj2pKbpJxsiV4vikKV AzNkhxiNc7tAZxFCW0FXAoxNDy7gl0bXwN7W1IbDNvMEsHlQYfZU2TegyDtIBLCKswMz 6Qdk57Knm3exkF2CreRDpsqaswnhhyPME3TodpG0zNUBs8EzUVl93za0DWjAo5Df5c0A j9wFFmuLq9DZoyGRPLaHyB3EdUgFK05AWiFKOblDmXRlS8oYc4Y0U7W6rao1y157FPhK W+GQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=l3v218yDK5l9cFhIQrzVFdTT4uPp68P8dzI+M4o79B4=; b=afZmxxlHGdowfWj8stmznmKqoHJYFdpb8C/LyBxCbcaqnM8a7VWguv5KphB0hEipv+ to3CN3i3PuYIk2Ob3pQeUQyKzK1ZgJhHf+2R8DvmC2rc6BOIb/Ychhgl/O029Ka+bWvp JTtWpVsFgT1XYpWiHFfO4aicDSuciJ2vJvj9cuSyqFFFHp3Ku+XV09NYr0sA4hISXDUg LrSh5V/qtsChEqMBDJPHtpVv92DzeHQX7/ReqMVZf3RVlGQj1KRka/30d8E1b5bPePNz VefHTPylnSHzpwVAJ1Sca86aUvEYkacd/Am+/20/23WWn643j8DsbImgoHJrad12P7mk acPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=lpzw5vOB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y12-20020a17090aa40c00b0024e0f3308a0si1854302pjp.32.2023.06.16.13.43.20; Fri, 16 Jun 2023 13:43:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=lpzw5vOB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232604AbjFPUfM (ORCPT + 99 others); Fri, 16 Jun 2023 16:35:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55388 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235399AbjFPUey (ORCPT ); Fri, 16 Jun 2023 16:34:54 -0400 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF2B63A92; Fri, 16 Jun 2023 13:34:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1686947693; x=1718483693; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=M4+ZSao6t8hnC6QT4ItA5tKP2pHPLCNAcpFWdcdgUh4=; b=lpzw5vOBflPjXkfUa+lQ/sFpj56smCPC85YTtoe9HFTDk+I+H37f6cKe GupekwVqok3i8pbQeUHwN3LvQHn2wO+h7LP1s4iIwS48bvDJiwlEX/nIN fgdYpYWdZIQ4dS9PFL2oCqcfP5s80vTosYKj8RbuwAGOqPxvLdkWg1liW AE7E2eT+HLqQqFH5FtvSmOVgbYqxvfoEFJVqiGMZXFHQFOF4bbEhUmo0R R5NsgcinYAY5tkk/1ed9oS8IzI8PC1lrWKzqUOPfICWIUn23yA0TMLnxv n3AfSWyQ33AwunOwNj3+xWGEGVE4YDeHbMkUa8QecriJbsUHve7HH1rU8 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10743"; a="358181780" X-IronPort-AV: E=Sophos;i="6.00,248,1681196400"; d="scan'208";a="358181780" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jun 2023 13:34:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10743"; a="802964401" X-IronPort-AV: E=Sophos;i="6.00,248,1681196400"; d="scan'208";a="802964401" Received: from inesxmail01.iind.intel.com ([10.223.154.20]) by FMSMGA003.fm.intel.com with ESMTP; 16 Jun 2023 13:34:50 -0700 Received: from inlubt0316.iind.intel.com (inlubt0316.iind.intel.com [10.191.20.213]) by inesxmail01.iind.intel.com (Postfix) with ESMTP id 5530E911E9; Sat, 17 Jun 2023 02:04:49 +0530 (IST) Received: by inlubt0316.iind.intel.com (Postfix, from userid 12101951) id 505B31D3; Sat, 17 Jun 2023 02:04:49 +0530 (IST) From: Raag Jadav To: linus.walleij@linaro.org, mika.westerberg@linux.intel.com, andriy.shevchenko@linux.intel.com Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, mallikarjunappa.sangannavar@intel.com, pandith.n@intel.com, Raag Jadav Subject: [PATCH for-next v1 2/3] pinctrl: baytrail: add warning for BYT_VAL_REG retrieval failure Date: Sat, 17 Jun 2023 02:03:55 +0530 Message-Id: <20230616203356.27343-3-raag.jadav@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230616203356.27343-1-raag.jadav@intel.com> References: <20230616203356.27343-1-raag.jadav@intel.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768893410185231942?= X-GMAIL-MSGID: =?utf-8?q?1768893410185231942?= Add warning for BYT_VAL_REG retrieval failure and continue such case to avoid unintended reads/writes in pm_ops. Signed-off-by: Raag Jadav --- drivers/pinctrl/intel/pinctrl-baytrail.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/pinctrl/intel/pinctrl-baytrail.c b/drivers/pinctrl/intel/pinctrl-baytrail.c index 54d3c5c26944..97ead2c58b66 100644 --- a/drivers/pinctrl/intel/pinctrl-baytrail.c +++ b/drivers/pinctrl/intel/pinctrl-baytrail.c @@ -1758,6 +1758,10 @@ static int byt_gpio_suspend(struct device *dev) vg->context.pads[i].conf0 = value; reg = byt_gpio_reg(vg, pin, BYT_VAL_REG); + if (!reg) { + dev_warn(vg->dev, "Pin %i: can't retrieve VAL\n", i); + continue; + } value = readl(reg) & BYT_VAL_RESTORE_MASK; vg->context.pads[i].val = value; } @@ -1794,6 +1798,10 @@ static int byt_gpio_resume(struct device *dev) } reg = byt_gpio_reg(vg, pin, BYT_VAL_REG); + if (!reg) { + dev_warn(vg->dev, "Pin %i: can't retrieve VAL\n", i); + continue; + } value = readl(reg); if ((value & BYT_VAL_RESTORE_MASK) != vg->context.pads[i].val) { From patchwork Fri Jun 16 20:33:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raag Jadav X-Patchwork-Id: 109361 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp1601238vqr; Fri, 16 Jun 2023 13:37:17 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6ibcO8L35L50kCB0N4gQogtYQEPiRALzOOldhnnGpBb5TAUHYWLoThZQ2D/uvByB2OMwx2 X-Received: by 2002:a05:6808:2205:b0:39a:b347:e603 with SMTP id bd5-20020a056808220500b0039ab347e603mr3895250oib.55.1686947837131; Fri, 16 Jun 2023 13:37:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686947837; cv=none; d=google.com; s=arc-20160816; b=AG4YDVZnMTeZU+aeW5mG1cYI6/yMGLMhy6S6qsCz2h5ZC8GJCCe14oX+2XpVNu/VAY S+Rdsw+EhQxdTfL9ZN/1ug1w+SCWAq/BsKP23WuyEfEJK0NfjjPcMwUbXo7TytI3UMEe gcmw2CJQklZAAJmAE/Ue4LBK58QPhen2z9fbs0LEtSr9h0byCz66unmvh2iwC3xL9KbO VSxtBOydUvKHRtY48tw8Wh/TEALVqbPS4VT/yevrlRoH0HoZJ9AqOsH/IHSeO4aUfRpE u/X7MJPd+f8MkNsfM4S6qOpqbt+LlhjcNvJrZD6UYl+MSzlnCRLD9+DbMDjjmSV0aDxw eM/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=ivIgUdp6sPgYFFh8hMcp0Gstm0CEoesBooKN/iQfx78=; b=r2pEUZUsl5YP4yL6MofQG/KQQUb47/71yWRrkRuNdC++8O5LSHiyfoyxt7w/AuSK0x H9MhXQ3McnZOW7qj1uE+U2nmGumkuo5uMvVJ/ct2OSaT3lBwh1ZF1btl68DF8dJjGmLi 7Mu7s7y0bgBWTVmWGOJtlzR92XNZ2h0KOw/lgdd5A7RiPRNv2SyHDK2nwT6HyQAK0RPT PHDSrdC5wjRQ6yrvDvehwQ4g0fHs8gO+C68oQysAVQKdBNAiCNDekm30K1hrgk8x42Da XDKo0OJNJNDaclkRV0GPDJw47h+Tm9OfhIaXrcI46gtrydMeTvVMPqhxr+37QX3UfRJ5 yBGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ac68FdO8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c24-20020a17090ad91800b002527ec91a2csi2255409pjv.98.2023.06.16.13.37.04; Fri, 16 Jun 2023 13:37:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ac68FdO8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229967AbjFPUfP (ORCPT + 99 others); Fri, 16 Jun 2023 16:35:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55380 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233180AbjFPUey (ORCPT ); Fri, 16 Jun 2023 16:34:54 -0400 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E8DF3A9B; Fri, 16 Jun 2023 13:34:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1686947693; x=1718483693; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=gqFVDbmVob3I2MoqOIXVaTRuNrQ5hYWbmLsucJsf0nY=; b=ac68FdO8tQy5GdqPGg00jlGyicPp/O8zg5oDTh5gS4tMXn750INuM/qg aAvSFlkz+zEwD0rarNEzT0po+jYyQYSqwZ/G4pPIFrcIxwVCwYyz8C2l8 xWF+2pRQxXK/K1acH47LnR3ZSEFiB6T+Qinj84DLbg9BZeIgpFJ2wJu8v d3IUrGzcWAV9pVMtVpgI1L7oRkJJCIe40cpjegMzty6r4Z8o5cud8r2Jb nSvlAAWfkUW+vNHpGDzO8OZWR490D6C2Z1421c0O5wfDHX22berNG1ST0 ilcfGTtjilIQbijl+HODZQ7IQVTjE0JpH8H6FT/WTTXk/KYygBoHyq+kF g==; X-IronPort-AV: E=McAfee;i="6600,9927,10743"; a="358181776" X-IronPort-AV: E=Sophos;i="6.00,248,1681196400"; d="scan'208";a="358181776" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jun 2023 13:34:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10743"; a="802964400" X-IronPort-AV: E=Sophos;i="6.00,248,1681196400"; d="scan'208";a="802964400" Received: from inesxmail01.iind.intel.com ([10.223.154.20]) by FMSMGA003.fm.intel.com with ESMTP; 16 Jun 2023 13:34:50 -0700 Received: from inlubt0316.iind.intel.com (inlubt0316.iind.intel.com [10.191.20.213]) by inesxmail01.iind.intel.com (Postfix) with ESMTP id 57A7B911EA; Sat, 17 Jun 2023 02:04:49 +0530 (IST) Received: by inlubt0316.iind.intel.com (Postfix, from userid 12101951) id 5461CCA; Sat, 17 Jun 2023 02:04:49 +0530 (IST) From: Raag Jadav To: linus.walleij@linaro.org, mika.westerberg@linux.intel.com, andriy.shevchenko@linux.intel.com Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, mallikarjunappa.sangannavar@intel.com, pandith.n@intel.com, Raag Jadav Subject: [PATCH for-next v1 3/3] pinctrl: baytrail: invert if condition Date: Sat, 17 Jun 2023 02:03:56 +0530 Message-Id: <20230616203356.27343-4-raag.jadav@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230616203356.27343-1-raag.jadav@intel.com> References: <20230616203356.27343-1-raag.jadav@intel.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768893015078327265?= X-GMAIL-MSGID: =?utf-8?q?1768893015078327265?= Invert if condition and get rid of redundant else. Signed-off-by: Raag Jadav --- drivers/pinctrl/intel/pinctrl-baytrail.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/pinctrl/intel/pinctrl-baytrail.c b/drivers/pinctrl/intel/pinctrl-baytrail.c index 97ead2c58b66..27aef62fc7c0 100644 --- a/drivers/pinctrl/intel/pinctrl-baytrail.c +++ b/drivers/pinctrl/intel/pinctrl-baytrail.c @@ -753,9 +753,7 @@ static void byt_gpio_clear_triggering(struct intel_pinctrl *vg, unsigned int off value = readl(reg); /* Do not clear direct-irq enabled IRQs (from gpio_disable_free) */ - if (value & BYT_DIRECT_IRQ_EN) - /* nothing to do */ ; - else + if (!(value & BYT_DIRECT_IRQ_EN)) value &= ~(BYT_TRIG_POS | BYT_TRIG_NEG | BYT_TRIG_LVL); writel(value, reg);