Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2326108ybi; Mon, 17 Jun 2019 02:56:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqyPwEWF9xsC1lUNh327631YPC+Fa6T/P0TE1C2zpWK8vjpj0Mm1nr5LEJ9SUaLsutofAAAp X-Received: by 2002:a17:90a:9f0b:: with SMTP id n11mr24738601pjp.98.1560765364495; Mon, 17 Jun 2019 02:56:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560765364; cv=none; d=google.com; s=arc-20160816; b=Vb2LoFXo8EKBADH7lqu85Pz0t6oVB3eXAKy5h5WesxLeXwbW9JgImnOnHaIgYz4LAL fJlTA/+5ks5NAS+IBQHNzDiGJ4IfZM8NphATEInFtU/EXa67oAHB8K+S4/9mK7m/4kxL ZRqY+Xs7GasNQriisCiY8kujp8G4dDmATmmxxmKaUXge7f3PYou1EDVAbzOThGg+RN8/ lI+tnXkw4ZCeQzMWKwTZhrJIcJE7nsEgOgi9yhs+UMBhNpiUMpaSPklW9hP2ipPa9Zax E1l9tiF0spQlQk3xNWYP81ja6ZvIzHBhlCFkBhd+rwZTGphcLLeHZLO3Ell621QdepKj 0HcA== 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; bh=Gz7l5QU0v2BG9XxWq9KJxEJKBev1SrBo+7T9Tv4RIJ4=; b=JFcb1/Dh36Ya13eSYrEhizMTTPfyGgjiDyhrYhEXMlGe0w3oXSqdU75xAndggRi8eR TGAalXfbgSpxgvI9Ff6Q64kRDaGd3U0S+rfYLiBEKwYR8WraKGpLZ8QDA1D7bUzZfikN fk6DMRRNFpdpgyGuewAtmLKM+45HtQsQX4lqgZNiT0IfymYXPtpjaIEj4SuCVB2OMhXj w1npo9f63Ar2IlxnPFQFIsaqPJjAPB0Ta5b4LjhFPO+U8rspsgITIGEWqk6XIc57FJko 1pDp46AY+7p3VrQ6seF7JFsNj7mSZkzGcg5+mbvVROxGuMmQXLEMViQVYNNmv2IaKO7B Udlw== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 6si10037802pfe.21.2019.06.17.02.55.48; Mon, 17 Jun 2019 02:56:04 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727678AbfFQJzl convert rfc822-to-8bit (ORCPT + 99 others); Mon, 17 Jun 2019 05:55:41 -0400 Received: from mail-ot1-f66.google.com ([209.85.210.66]:41074 "EHLO mail-ot1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726248AbfFQJzk (ORCPT ); Mon, 17 Jun 2019 05:55:40 -0400 Received: by mail-ot1-f66.google.com with SMTP id 107so8666298otj.8; Mon, 17 Jun 2019 02:55:40 -0700 (PDT) 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=J7SuI9vLUAwXvgnaQIuYQGNgcBOBLIEw7OPkq5rLb6s=; b=pLJnrx8fXWIt6w654Ry6SXdJUWrdxmaaA5t/T8HlOW0vZOxdcM9IYY71DD0kRpt86+ ZxcM7055p2F7Wr953yYT1LVMGevexZasDUXXceTXxBD4JD9AXSWdPhvoRH9a6e1/v1/P MHdIuaXMO0fIVKToe+muUWJwYKCWQocLEvb6qtpICPngmZYuk8iPguOXipFQHrujTCG3 sVFOb6Suz7M5aaqmcPqK1mZbSECVJIkcZOU74PDXob50lJwlP+B7KlF3qYDQJqbs4bCa bsvD5Dq8xQeId7es/Va09qkgE6IZ+PE//F95M79sjQnxEadb3O9H7dRVQBXG8SOOf9CC /rMw== X-Gm-Message-State: APjAAAWR5gEEWu3/SyWJZThMV2Z1pwtE4E8WRHLsYV6BI6to6gUdODZD EtJMjm9lnapCt+C/ueiu474ok3a6pAZj1BHpGR4= X-Received: by 2002:a9d:5e99:: with SMTP id f25mr29823354otl.262.1560765339826; Mon, 17 Jun 2019 02:55:39 -0700 (PDT) MIME-Version: 1.0 References: <39e46643-d799-94b7-4aa5-d6d99d738f99@web.de> <20190614133840.GN9224@smile.fi.intel.com> <20190614141004.GC7234@kroah.com> In-Reply-To: <20190614141004.GC7234@kroah.com> From: "Rafael J. Wysocki" Date: Mon, 17 Jun 2019 11:55:28 +0200 Message-ID: Subject: Re: [PATCH] drivers: Provide devm_platform_ioremap_resource_byname() To: Greg Kroah-Hartman Cc: Andy Shevchenko , Markus Elfring , Jack Ping CHNG , kernel-janitors@vger.kernel.org, "Rafael J. Wysocki" , LKML , Bartosz Golaszewski , Enrico Weigelt , Himanshu Jha , Linus Walleij Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 14, 2019 at 4:10 PM Greg Kroah-Hartman wrote: > > On Fri, Jun 14, 2019 at 04:38:40PM +0300, Andy Shevchenko wrote: > > +Cc: Jack Ping, who did internally the same > > > > On Fri, Jun 14, 2019 at 03:26:25PM +0200, Markus Elfring wrote: > > > From: Markus Elfring > > > Date: Fri, 14 Jun 2019 15:15:14 +0200 > > > > > > The functions “platform_get_resource_byname” and “devm_ioremap_resource” > > > are called together in 181 source files. > > > This implementation detail can be determined also with the help > > > of the semantic patch language (Coccinelle software). > > > > > > Wrap these two calls into another helper function. > > > Thus a local variable does not need to be declared for a resource > > > structure pointer before and a redundant argument can be omitted > > > for the resource type. > > > > This one makes sense. > > Though I'm not sure Greg will see your message. > > Nope, didn't see it, don't want to see it, it will only cause more work > in the longrun... > > > Rafael, maybe you can apply this one? > > Um, don't go around maintainers please, that's rude. Totally agreed. And there would be no reason for me to even consider applying it, really. > There is a reason this specific developer is in my blacklist, and perhaps they should be > in yours as well :) > > > FWIW, > > Reviewed-by: Andy Shevchenko > > > > > > > > Signed-off-by: Markus Elfring > > > --- > > > drivers/base/platform.c | 18 ++++++++++++++++++ > > > 1 file changed, 18 insertions(+) > > > > > > diff --git a/drivers/base/platform.c b/drivers/base/platform.c > > > index 4d1729853d1a..c1f19a479dd7 100644 > > > --- a/drivers/base/platform.c > > > +++ b/drivers/base/platform.c > > > @@ -97,6 +97,24 @@ void __iomem *devm_platform_ioremap_resource(struct platform_device *pdev, > > > return devm_ioremap_resource(&pdev->dev, res); > > > } > > > EXPORT_SYMBOL_GPL(devm_platform_ioremap_resource); > > > + > > > +/** > > > + * devm_platform_ioremap_resource_byname > > > + * Call devm_ioremap_resource() for a platform device > > > + * > > > + * @pdev: platform device to use both for memory resource lookup as well as > > > + * resource management > > > + * @name: resource name > > > + */ > > > +void __iomem *devm_platform_ioremap_resource_byname(struct platform_device *pdev, > > > + const char *name) > > > +{ > > > + struct resource *res; > > > + > > > + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, name); > > > + return devm_ioremap_resource(&pdev->dev, res); > > > +} > > > +EXPORT_SYMBOL_GPL(devm_platform_ioremap_resource_byname); > > > #endif /* CONFIG_HAS_IOMEM */ > > I don't like adding new apis with no user. I agree with that too. Cheers!