Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2562215pxb; Tue, 9 Mar 2021 05:52:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJz1tPSQ17g3TED+Zf/5hW2JxepR5wClPN5u4mCJKiBFjWYWbvEXjohcrJhJtHIpzoqEtxOk X-Received: by 2002:a17:906:1352:: with SMTP id x18mr19972880ejb.545.1615297932123; Tue, 09 Mar 2021 05:52:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615297932; cv=none; d=google.com; s=arc-20160816; b=AN2DK8leNNfAcbJcCHgIqRq2+XEkAxMNntp6yUaQxcAGtWXeL8fQJBCvIec7+YKPNb Khvuka16GII41OtCHvyhN7CvD3ZXxWzGYh8m34BL+vOoHpSviQpin5b+1oyYcjNBCMJe nCQK3EAeEX5M0k2/R/dY23QGYM2PP6mgcwGBx701CQsn5F+RFMOMRUKN/KmMUC3ZGmI3 vTRkd6+7w5NQdjbtCN358UpBsYXMBCbxu51ZMPqPLtqsyUOfqZ/VfNEOBIy2Jo2O7I/l 9ss+2GAxwjfYaXrd/HfD2erz3UM5LxbEvjCoQteW5oO49x/U3oryYO0UPQmXDdDhEB3O chHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=mpza37x2a6jOovJHwQKMXxHs0CUszPBiFGSPamapf+Y=; b=JJ8Iuk2UOtLNvZ/LmgnAvDPmAl8qD5nt5tXTvrkNgQ1L3mMvF9e0++CcY1qp9iJnFv FVh5i+aSYkqR1BGB8hgcV+d/OjOrcOjn/SrC+OhRBsM0ZyZuA8aVgWm9E0e3RBRgiFK9 zlUA/GV9684LUeLiwtUQXYH0M43iNHqBW/PFxLFID080Y6EAzQWAUS+csZfLSjDge5v5 M6zR+zoqElHffC8A8nCeEq3Kmm6mEfU7FKi5Vzy1lYGhS4sXgemLJxQ61dkKtl7By5px EZQZzoNB0lFArvnIReuTsUQOf03NR/jgPZQjc+cHaw9BD0bRxXxIfj/AJvnL1/UtGSSc Pc3w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v22si5224319edc.137.2021.03.09.05.51.49; Tue, 09 Mar 2021 05:52:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231445AbhCINt0 (ORCPT + 99 others); Tue, 9 Mar 2021 08:49:26 -0500 Received: from mail-ot1-f47.google.com ([209.85.210.47]:33262 "EHLO mail-ot1-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231428AbhCINs5 (ORCPT ); Tue, 9 Mar 2021 08:48:57 -0500 Received: by mail-ot1-f47.google.com with SMTP id j8so12877234otc.0; Tue, 09 Mar 2021 05:48:57 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=mpza37x2a6jOovJHwQKMXxHs0CUszPBiFGSPamapf+Y=; b=Vm+ziBbgzb9jzKIdrPvLMr3V1+dC1/IVrey11QCKSJS+YyCsL4AkEbmcu/YhL81IZM ZiJSeRA4HAvTjPcz4iY/VL5oh6p2rkZUUiKrKLkPYOIaeWbWc87tmMgmnKPHNaUs/B67 f9H04ux1h5rKu67oLSqEexA/3y64wEmngyk5/K2kOAnTDSVYpwz5BrrCmVIj3VkMV0Fz TQ8OsiLzytxVumOnseygx+FB7QJaX4RtszLC3vM9Vuikak4X0x0u1qsiURolfG6GIuqg qShXZWGfd58Ns9FY16uEmkXALrberZcBNDJdkrmeCtrQL93r5qT3OHGxvh07YewS0W9F MZAA== X-Gm-Message-State: AOAM531uVllYbxPHne4sSJuE1x1gSMLytalcWseVlU8tfvk7U/MzdNXm Ojsw+B3PKFBd7QNrksFLYwxVn25mR8obzfGC7nY= X-Received: by 2002:a05:6830:1e03:: with SMTP id s3mr13608965otr.321.1615297736685; Tue, 09 Mar 2021 05:48:56 -0800 (PST) MIME-Version: 1.0 References: <20210309093736.67925-1-andriy.shevchenko@linux.intel.com> <20210309093736.67925-7-andriy.shevchenko@linux.intel.com> In-Reply-To: <20210309093736.67925-7-andriy.shevchenko@linux.intel.com> From: "Rafael J. Wysocki" Date: Tue, 9 Mar 2021 14:48:44 +0100 Message-ID: Subject: Re: [PATCH v6 6/6] gpiolib: Fold conditionals into a simple ternary operator To: Andy Shevchenko Cc: Mika Westerberg , Linus Walleij , "open list:DOCUMENTATION" , Linux Kernel Mailing List , "open list:GPIO SUBSYSTEM" , ACPI Devel Maling List , Marc Zyngier , Jonathan Corbet , Bartosz Golaszewski , Thomas Gleixner , "Rafael J. Wysocki" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 9, 2021 at 10:37 AM Andy Shevchenko wrote: > > It's quite spread code to initialize IRQ domain options. > Let's fold it into a simple oneliner. > > Signed-off-by: Andy Shevchenko Reviewed-by: Rafael J. Wysocki > --- > drivers/gpio/gpiolib.c | 9 ++------- > 1 file changed, 2 insertions(+), 7 deletions(-) > > diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c > index afee48e7dd41..cee4333f8ac7 100644 > --- a/drivers/gpio/gpiolib.c > +++ b/drivers/gpio/gpiolib.c > @@ -1458,7 +1458,6 @@ static int gpiochip_add_irqchip(struct gpio_chip *gc, > { > struct fwnode_handle *fwnode = dev_fwnode(&gc->gpiodev->dev); > struct irq_chip *irqchip = gc->irq.chip; > - const struct irq_domain_ops *ops = NULL; > unsigned int type; > unsigned int i; > > @@ -1496,15 +1495,11 @@ static int gpiochip_add_irqchip(struct gpio_chip *gc, > return ret; > } else { > /* Some drivers provide custom irqdomain ops */ > - if (gc->irq.domain_ops) > - ops = gc->irq.domain_ops; > - > - if (!ops) > - ops = &gpiochip_domain_ops; > gc->irq.domain = irq_domain_create_simple(fwnode, > gc->ngpio, > gc->irq.first, > - ops, gc); > + gc->irq.domain_ops ?: &gpiochip_domain_ops, > + gc); > if (!gc->irq.domain) > return -EINVAL; > } > -- > 2.30.1 >