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 X-Spam-Level: X-Spam-Status: No, score=-9.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AFB0FC2BBFD for ; Thu, 9 Apr 2020 14:12:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8622420692 for ; Thu, 9 Apr 2020 14:12:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727220AbgDIOMm (ORCPT ); Thu, 9 Apr 2020 10:12:42 -0400 Received: from mga14.intel.com ([192.55.52.115]:57758 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727181AbgDIOMm (ORCPT ); Thu, 9 Apr 2020 10:12:42 -0400 IronPort-SDR: sAMoVicTidBwtv5g+z7ZjqyMdQJcdNl+nYFrN999Ir7XksvnmbraDzxvQUQp+PkSS5u2ABZHkO RZw+i2eZBc0A== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Apr 2020 07:12:35 -0700 IronPort-SDR: LnLSyMuXg2KQbPYEz1+0tgSmqkq1IpD+aLHul01SP59gm2fesoZcfk2h6Pn4ccEpXyrps+oxZn yCNy531IzM+g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,363,1580803200"; d="scan'208";a="251905223" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga003.jf.intel.com with ESMTP; 09 Apr 2020 07:12:33 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id D10F1CAE; Thu, 9 Apr 2020 17:12:29 +0300 (EEST) From: Andy Shevchenko To: Linus Walleij , Bartosz Golaszewski , linux-gpio@vger.kernel.org, Serge Semin Cc: Andy Shevchenko Subject: [PATCH v1 12/13] gpio: dwapb: Use positive conditional in dwapb_configure_irqs() Date: Thu, 9 Apr 2020 17:12:27 +0300 Message-Id: <20200409141228.49561-13-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200409141228.49561-1-andriy.shevchenko@linux.intel.com> References: <20200409141228.49561-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org The negative conditionals are harder to parse by reader. Switch to positive one in dwapb_configure_irqs(). Signed-off-by: Andy Shevchenko --- drivers/gpio/gpio-dwapb.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/gpio/gpio-dwapb.c b/drivers/gpio/gpio-dwapb.c index 7789410fe15e..bbaf909a463a 100644 --- a/drivers/gpio/gpio-dwapb.c +++ b/drivers/gpio/gpio-dwapb.c @@ -413,15 +413,7 @@ static void dwapb_configure_irqs(struct dwapb_gpio *gpio, irq_gc->chip_types[1].type = IRQ_TYPE_EDGE_BOTH; irq_gc->chip_types[1].handler = handle_edge_irq; - if (!pp->irq_shared) { - int i; - - for (i = 0; i < pp->ngpio; i++) { - if (pp->irq[i] >= 0) - irq_set_chained_handler_and_data(pp->irq[i], - dwapb_irq_handler, gpio); - } - } else { + if (pp->irq_shared) { /* * Request a shared IRQ since where MFD would have devices * using the same irq pin @@ -435,6 +427,14 @@ static void dwapb_configure_irqs(struct dwapb_gpio *gpio, gpio->domain = NULL; return; } + } else { + int i; + + for (i = 0; i < pp->ngpio; i++) { + if (pp->irq[i] >= 0) + irq_set_chained_handler_and_data(pp->irq[i], + dwapb_irq_handler, gpio); + } } for (hwirq = 0 ; hwirq < ngpio ; hwirq++) -- 2.25.1