Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp2277643ybd; Mon, 24 Jun 2019 03:48:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqw04kMQGrz67pR31EeBwRDHsTrLBJiBMony42/Wvu+UaAokmBoO+tbszQUd8hOL77ekmfDb X-Received: by 2002:a63:6507:: with SMTP id z7mr10474110pgb.186.1561373309207; Mon, 24 Jun 2019 03:48:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561373309; cv=none; d=google.com; s=arc-20160816; b=qjeLloHUHwZeSpn49L/eaIMq+k1FaHEg2glRdhugRCEDH4MHtRLULUmTvZaT2l3nwx z28XfSgQcG1d0HM1f+aF88JiamP8Nn1lol5tqWqDeFWc4MyPiTowgOiJdyUCn7HauilT 5n1jyPVbEc/R34a8TMAyKM0sX53zAVYitYQxnX8O7xNKHC6YQIJjZtOHmF2nCI1u59PP wGyAQml4I+ARYdZ0UVo6x8rc2DMfNeddGzUnsUQIWZO3sFAEGGgOE/lnBY4X11YtPiHz NI54keqv7hT5ClIx2TBLP+3TUS2voTNLtU8ycwWGptk/1B/Snw7lHpFgKzpNu5eJibtW XWKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=fBt9QktoLd64Chah7MFgGo/Ww4Rt6gZg9l4gfXKcmpI=; b=W7VKaRjMDie7WfU2GRDV2+boxQ+I0k5JWHjvJCwEtRJEZkRaGOsYe9WhsrFlxphHSU 86lOzLthFVMjNngOy9dmxsc82nc/hJbroLfBnh7pc+YUHWrKfV6Jqh55vCJ8hvr0T62Y jVibGtYD9P4mcXfZN9AmyPPfRECZH8RFwhGg8V+nHODkM8ui4samCWxDsGzUzuyYzCUu Ax/nk3VQ/zD8cBLuT6T9nRSVufUHUpXiJUmDr2vTjMHt4bZCd1GBvpYfOrXRnu6NeMCj FeNCJa5YTiiNFMeXqQpBsYrb6FBcEWrzu6wpROJLi4nB7Qr7YwlTETTQwV27WN/GtRCn PYcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=BdSYOGyi; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h12si7297204pfn.171.2019.06.24.03.48.13; Mon, 24 Jun 2019 03:48:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=BdSYOGyi; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729204AbfFXKqe (ORCPT + 99 others); Mon, 24 Jun 2019 06:46:34 -0400 Received: from mail-io1-f68.google.com ([209.85.166.68]:34100 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728117AbfFXKqe (ORCPT ); Mon, 24 Jun 2019 06:46:34 -0400 Received: by mail-io1-f68.google.com with SMTP id k8so469403iot.1 for ; Mon, 24 Jun 2019 03:46:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=fBt9QktoLd64Chah7MFgGo/Ww4Rt6gZg9l4gfXKcmpI=; b=BdSYOGyiwQEVHWX5UU8ZLqciWdf/4508u9hIvRwfy6/rOlHok3nrDXGlOI8L34d0j4 IxFRRK1iYL0fWOTz+lxXjYaWc8Q1NdfJVN6WlYMLCF1DdbdmuM6YgcCdQHDIofOHErUm LsdJ462/cM7FfcbN7lCFOvtOr2lpV+JXpzMTs8fVcTfd47eNWJpkJnbl56fMARw7oqIy lZSJUoA0b1L6CBwYFgeW0dP1kvZc+xlMsAm+UoQeaxtZUa1KKpc/9jw35oTX8RCgRMAy XdkLWN8/xVghtWNIKtjoO77HAGYgoIOMH6h5MHyaWd2YtG7BlK7vsop6klNPR78G+Z0B 84uA== 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:content-transfer-encoding; bh=fBt9QktoLd64Chah7MFgGo/Ww4Rt6gZg9l4gfXKcmpI=; b=FrJMw8adSqV8opkAuMKEIjueLoueJQowwb1Cjdahet85Y5yI42aSHfAEQ5dcj11NcP OuOEU0URkxSKbXDfDu7IIV4NIrczqTB2VgDeGj2qupoZMVv5MjVO6kk1WlqAz7kBR5DO 6/4p2sf2ZCTXl+V+YsNMBUnp2sQNWS5r4+k/uK0fxlA8HHFcSP4p8OBZCuJKPcXHdfSE dMv+shR86yPwZ5/OswU2nDFZ1dM93kD28WcHFdcsenrlOhVrJjMFDBLef6BqanVsDNb3 NGpwmdOApRIZJt+eKRsHXXI6sdfDGKMqjOmwW42qffxGuYfO4xZszMMCyOP0CcOChvAK Ei+g== X-Gm-Message-State: APjAAAXQ+XBFUrdLPa1mBSw/1jHNqZ6h4fm4bUyQmGDd+1PrhAzMY7Z7 NufZXjlFtJuEdMC6c91YHn5WvxDkQx7dPNcrCDVGWg== X-Received: by 2002:a5e:a712:: with SMTP id b18mr19413363iod.220.1561373193303; Mon, 24 Jun 2019 03:46:33 -0700 (PDT) MIME-Version: 1.0 References: <20190221162627.3476-1-brgl@bgdev.pl> <9efcbce2-4d49-7197-a3d8-0e83850892d5@web.de> <39ae399a-c606-c6de-f84d-35e39d0410c0@metux.net> In-Reply-To: <39ae399a-c606-c6de-f84d-35e39d0410c0@metux.net> From: Bartosz Golaszewski Date: Mon, 24 Jun 2019 12:46:22 +0200 Message-ID: Subject: Re: [PATCH] drivers: Adjust scope for CONFIG_HAS_IOMEM before devm_platform_ioremap_resource() To: "Enrico Weigelt, metux IT consult" Cc: Bartosz Golaszewski , Markus Elfring , Andy Shevchenko , Greg Kroah-Hartman , Keerthy , Linus Walleij , "Rafael J. Wysocki" , linux-gpio , kernel-janitors@vger.kernel.org, LKML Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org pon., 24 cze 2019 o 12:05 Enrico Weigelt, metux IT consult napisa=C5=82(a): > > On 24.06.19 10:29, Bartosz Golaszewski wrote: > > pt., 14 cze 2019 o 18:50 Markus Elfring napisa= =C5=82(a): > >> > >> From: Markus Elfring > >> Date: Fri, 14 Jun 2019 17:45:13 +0200 > >> > >> Move the preprocessor statement =E2=80=9C#ifdef CONFIG_HAS_IOMEM=E2=80= =9D so that > >> the corresponding scope for conditional compilation includes also comm= ents > >> for this function implementation. > >> > >> Signed-off-by: Markus Elfring > >> --- > >> drivers/base/platform.c | 2 +- > >> 1 file changed, 1 insertion(+), 1 deletion(-) > >> > >> diff --git a/drivers/base/platform.c b/drivers/base/platform.c > >> index 4d1729853d1a..a5f40974a6ef 100644 > >> --- a/drivers/base/platform.c > >> +++ b/drivers/base/platform.c > >> @@ -78,6 +78,7 @@ struct resource *platform_get_resource(struct platfo= rm_device *dev, > >> return NULL; > >> } > >> EXPORT_SYMBOL_GPL(platform_get_resource); > >> +#ifdef CONFIG_HAS_IOMEM > >> > >> /** > >> * devm_platform_ioremap_resource - call devm_ioremap_resource() for = a platform > >> @@ -87,7 +88,6 @@ EXPORT_SYMBOL_GPL(platform_get_resource); > >> * resource management > >> * @index: resource index > >> */ > >> -#ifdef CONFIG_HAS_IOMEM > >> void __iomem *devm_platform_ioremap_resource(struct platform_device *= pdev, > >> unsigned int index) > >> { > >> -- > >> 2.22.0 > >> > > > > And what is the purpose of that? > > I can imagine that this could improve readability a little bit. Maybe if > one uses same fancy ide/editor that can fold code blocks like functions > and conditionals, this patch could make the code prettier. > > The patch seems pretty trivial and doesn't change any actual code, so > I don't see hard resons for rejecting it. > In its current form it makes the code even less readable. The #ifdef should actually be one line lower and touch the comment instead of the EXPORT_SYMBOL() related to a different function. Bart