Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp342887pxf; Thu, 8 Apr 2021 04:26:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyVusmHXPgE0zUFN0qsLW7p81/2Zog9UipBOtGVx+fhl7KyhmZWF7Pa3KE7uep5D4aBSvdv X-Received: by 2002:a05:6402:1004:: with SMTP id c4mr10766655edu.364.1617881212451; Thu, 08 Apr 2021 04:26:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617881212; cv=none; d=google.com; s=arc-20160816; b=m3xHKoY8VDsgteCQTZTzaUVJN78YnPOkCy44lTKsyGuFV3lrZV23sFfjqHkJJp3jbC PyGolyR4UFQdLQ/tMWdj0+2dFfqvidbZmgPM2N+W/MIH/vL0fNAVoCZfHH67pSdRxsTG ZbZopr+cn+Cq0Yobw/y323XgF4ylwavp4RXH3lB+Qjn3QLwPAyLHMYIIzOlZ33Drz1CH FsXb2YPy4BO5n74yxCUkYmz6QidV3YgyJpSliSKoH2u8KY0GBz6Q0zNmxylaYdHrx//M hFXlMGh+LWKIvAORc900VaCypzSldcqdlVSDGYyFzsGHai0x3XtTBqZ7B4mglCybBUaL 08SQ== 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:dkim-signature; bh=FNlHOXPoa1AVSwT64tviQKrmRjIP6/dQq2uo/ujEyXg=; b=j2kOI7q95Nn6PvUtGferUawTIYyLnTGu3c+pyFEc8Y9hModDTiqDsU4pj/md8MJZ8a NKmjBkuvo2w6JPUNCgoGruxeb6xJvVHpsjfEEsjFv9J75dTS5Y3QWBmpPAkt3EABR1OQ HXJHAUKkNYYHZCLAF2SYB24gX4DUSY7onxIjt1MXjMw0niu70wRr5dZlk3I7K9cfbK3R cwTdRl4PpBtFh/lai757fmoOnQGS3M4iKjYCDnT+0v7YA0FNr6/wCOxVuAlRU5OZVBBu 1BZaH/7vqwlLQy3N0qgAxmX6lUyamSXu9PCUHI7U647nHdLyw5X/6beRwu5df61R5vqC 0h4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="qp0/Rap3"; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id di12si9590815edb.271.2021.04.08.04.26.29; Thu, 08 Apr 2021 04:26:52 -0700 (PDT) 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; dkim=pass header.i=@gmail.com header.s=20161025 header.b="qp0/Rap3"; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231293AbhDHLZS (ORCPT + 99 others); Thu, 8 Apr 2021 07:25:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231145AbhDHLZR (ORCPT ); Thu, 8 Apr 2021 07:25:17 -0400 Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA604C061761; Thu, 8 Apr 2021 04:25:06 -0700 (PDT) Received: by mail-pl1-x62a.google.com with SMTP id p10so896211pld.0; Thu, 08 Apr 2021 04:25:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=FNlHOXPoa1AVSwT64tviQKrmRjIP6/dQq2uo/ujEyXg=; b=qp0/Rap3zfkW7RSQHOmAvkMYTUBWY2+8Bgzvs/A9UQK+O/r/Viauo5Rl//pUypVAO6 s42eIVBlLZ9Req69nMeB27hCmZ3kJYLqgSZiM/Lwjsno4YP4wuaDIoV1lP5m0B6dn63Y XM5nfhiXlBQ/n2U49Jycba8gJaXHVy7hpX4jGJ3SXaisjZ1WoXqQBG8MNB5vwXFGxgR7 tqD1xhiWSQCmbvXlddzNLD9yaV0OHzlwgboQM0jBCvDZP4qsAY+8Ra8OOM5x/N8QOA+H wcKy5b4Tq48vPsym77APSy5tTXFS6ZDkogixZcZsqyC/mdw7N0zFcTxZcIE55NUN2hpk +KsQ== 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=FNlHOXPoa1AVSwT64tviQKrmRjIP6/dQq2uo/ujEyXg=; b=pISWp2rNcXOuBq/y4ln6CPMwKtLPVOrD72H+xDzSgVtc4FgQ0YEVmhD9KMXqFUi3A9 YarCJwXP2T17CwWyyeDDz0MjQvbJjXzjfsRApwYX2G4eKO86nVDl11BuXu0AxRjSJkza Gw9maw8BlSkqa9Vn2QZjwsdfz8MKoSU9+JH76Gnp5eHHL+OkuGiksY1wXLWeFBlaFycX 5l4ygf/E7SJgRmHKkY3d5mW5hiqikraPAhMYUbCzw1jK44z7yGGPMSKA4G8uCtIsljIH 9LzAgVRCrr1heE8GMF6MVs1wFPQnkvPKKTQF9GiE53TlyCjvZ9hrUyjzqfFficfPkYKa Ohcg== X-Gm-Message-State: AOAM531/nEiGW1f76feGwYAds/z9SRT2IsJp4Y6JXwtSY9oPGa3eyloI vXHXF6oOL9H7TQi1WDqxVmrXuLgMZGC6/cQE/CVy3evo5MUgYfMW X-Received: by 2002:a17:90a:156:: with SMTP id z22mr8250717pje.181.1617881106488; Thu, 08 Apr 2021 04:25:06 -0700 (PDT) MIME-Version: 1.0 References: <20210402090542.131194-1-marcan@marcan.st> <20210402090542.131194-12-marcan@marcan.st> <20210407210317.GB16198@willie-the-truck> In-Reply-To: From: Andy Shevchenko Date: Thu, 8 Apr 2021 14:24:50 +0300 Message-ID: Subject: Re: [PATCH v4 11/18] asm-generic/io.h: implement pci_remap_cfgspace using ioremap_np To: Hector Martin Cc: Will Deacon , linux-arm Mailing List , Marc Zyngier , Rob Herring , Arnd Bergmann , Olof Johansson , Krzysztof Kozlowski , Mark Kettenis , Tony Lindgren , Mohamed Mediouni , Stan Skowronek , Alexander Graf , Linus Walleij , Mark Rutland , Jonathan Corbet , Catalin Marinas , Christoph Hellwig , "David S. Miller" , devicetree , Linux Documentation List , Linux-Arch , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 8, 2021 at 2:01 PM Hector Martin wrote: > On 08/04/2021 06.03, Will Deacon wrote: > >> I would rewrite above as > >> > >> void __iomem *ret; > >> > >> ret = ioremap_np(offset, size); > >> if (ret) > >> return ret; > >> > >> return ioremap(offset, size); > > > > Looks like it might be one of those rare occasions where the GCC ternary if > > extension thingy comes in handy: > > > > return ioremap_np(offset, size) ?: ioremap(offset, size); > > Today I learned that this one is kosher in kernel code. Handy! Let's go > with that. It depends on the maintainer. Greg, for example, doesn't like this. I have no strong opinion (I use both variants on case-by-case basis), though I think in headers better to spell out all conditionals clearly. -- With Best Regards, Andy Shevchenko