Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2945619ybi; Mon, 17 Jun 2019 13:15:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqzhhpyWIDLi7aKSoElpsBfu9OO3swyktcIljpIEq01d4w1eq5yjDTZq97Vto0G4QGK8UVOh X-Received: by 2002:a62:b517:: with SMTP id y23mr119938840pfe.182.1560802523984; Mon, 17 Jun 2019 13:15:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560802523; cv=none; d=google.com; s=arc-20160816; b=kU4glZ354cP9kZAxMAWVeoVIT+MjmOmf8B4md/fy1oCVmynCHbm2y+nETXX34lDLAh OnBt3U6GJHUoyrTPHqUmrm3RXa/1iHFnAvOd2XInkDBxrG45huoNo2lPK9AGIYu8kOqq 44o8xB9q9ZM5uJOHj6JHCw65v3GdIzFjCSH3lFZu1pATweknL678XcYRsvGqGG1Hw7+O AgWh7e+rNW/nLPwXnB9fidW3gDUNClttgFIDY8LmPutCZUnvDXKe0ItJlCVIcw53C24/ Wrk+VYdOz+H2lO0/UXs/ymyzTdgCFJWZxYBP1bwoozFbwFMHbX2If6kHGnJDkkBUQxye bdNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:to:from; bh=xENZsDiURkSz+c9dz8HiBnIfG1/bXLQ1ZpRjnljrzfQ=; b=UdHnjYOGAKOzP80Ad1uDB2+vxApH0suMbLdaKx0/VdBdpUTPZXC2E/N6VUFc9WdDOV zvy+3tLiBVmj00J6ABPug2+2d3BM4rmyGFA2MDnp5DPAeMVM/mE2lXSe5KLSUtzJDQjz XDUUCqRQdqCm1CgycmR91UFn/+EZO6A//PP5TQXI9OfNGxV+NfTBYLNyPXand5OX9e0N LYeTfNNuItG2tqlycfTscTDeXq40OYe7wCFoJyi6Y6GriVNzvSSZsGUQVWT2pzFamYU8 fC1IEJrQlPQiRHmMXDHanh4bsDZGJ65vw7vtlHW5EZ1++nrFrk7+pYpdtkz1wP0mUDRL HWTg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l1si12161004pgj.504.2019.06.17.13.15.08; Mon, 17 Jun 2019 13:15:23 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727337AbfFQUPE (ORCPT + 99 others); Mon, 17 Jun 2019 16:15:04 -0400 Received: from mout.kundenserver.de ([217.72.192.73]:32941 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726048AbfFQUPE (ORCPT ); Mon, 17 Jun 2019 16:15:04 -0400 Received: from orion.localdomain ([77.2.173.233]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MiJhQ-1iEl1c20F4-00fSZo; Mon, 17 Jun 2019 22:15:02 +0200 From: "Enrico Weigelt, metux IT consult" To: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] lib: devres: devm_ioremap_resource() make res parameter const Date: Mon, 17 Jun 2019 22:15:01 +0200 Message-Id: <1560802501-26956-1-git-send-email-info@metux.net> X-Mailer: git-send-email 1.9.1 X-Provags-ID: V03:K1:YhnmhRqTRDS4Imrf/9UQ5zF6995Hzn41OF7sKC4+b6bM+zx3bBn zZ2cosTlwkUFatCnEl91fBtB82S8oIgXvoymBQVWTH+vb2a0aUrtY0vDyjyTYbchsvURquM +Vg+l2FqrGi/nmzpY7+fZHSfDPJhxEkeu1OLaR79bLfoff5Hyel7VQb4XeDfxLPWn2rOEmJ cCW6lbpCGARf0kA9RREsw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:c+C4ZPlINKM=:P1uf8g7FqxdU75QuXNxLxa +ovI4iBKbFThrwp5tiRD8YEVbFP+jegnrnTsJpuYPea+s2VDxGqdXfm4Oh0aHbIR9L/2MwhSO 9byh0pTxWkNtO0Od1w1Lgr+5FG5izZJPj2muwwdXujEtqQp1mYqKvPkHSoGS5qKjBxRrGPYzM 2vcYbOWbMHTuvTi/tw44T8k/p9glITIoZ//rMIFX62KARk1OmYVYulUk9e1R3lrS0PYu4sML3 4EMSEgoPW9pdH9x78BUpOF8uFxmb0++8Six+LAVdsHnlGBq8kIqpj/ps8yfII//WWIhkMMDpc JZQQAo+mzbVvjjqXZT+fOfuepKJWSGkbBdGzW6jOrVVnIyehEnUUpYxXd9CxnLgJrGVDcGjUZ sDNA7YMLPuo4I2wr660gDPzWmUpUWHMTxPa7hC++XebNtfInc4B8We4pvQnS6dvq6o66Eq1FU pCTiOqpi1T1xtthXL8QnyD933VFSdZxcNqDLToymzUoGEHS1E5B+hFEqNjsNo6qLb4++r6f4Y BTQ5UevUj5EeyZM69g1dQGYyiIuDCA4TCkJhRC3tyfcm19rN6hOqnYMxj+piHwyvb7cMsqPQY MSesvKMBhrEOtziveG7gzxLTwNlcsN50MzoGDXdB2MG+lO7+eVeuCPFVRaQZdypF8CWQHZnls A6e2l6UepIxbCnSjgCXnVAqXI/hJEUhBEv4YiSB+S1Y6Juzwiyq+x6h27k79Cqc5H21TzEZvn mVE1j5xx79PQnnBN4cufp0vY4oyM3J/jZi5+vA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org devm_ioremap_resource() doesn't change the passed struct resource, so it can be a const pointer. Now, calls sites w/ fixed resources can declare them static. (in some cases possibly even __initconst) Signed-off-by: Enrico Weigelt --- include/linux/device.h | 3 ++- lib/devres.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/linux/device.h b/include/linux/device.h index 848fc71..4a295e3 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -704,7 +704,8 @@ extern unsigned long devm_get_free_pages(struct device *dev, gfp_t gfp_mask, unsigned int order); extern void devm_free_pages(struct device *dev, unsigned long addr); -void __iomem *devm_ioremap_resource(struct device *dev, struct resource *res); +void __iomem *devm_ioremap_resource(struct device *dev, + const struct resource *res); void __iomem *devm_of_iomap(struct device *dev, struct device_node *node, int index, diff --git a/lib/devres.c b/lib/devres.c index 69bed2f..6a0e9bd 100644 --- a/lib/devres.c +++ b/lib/devres.c @@ -131,7 +131,8 @@ void devm_iounmap(struct device *dev, void __iomem *addr) * if (IS_ERR(base)) * return PTR_ERR(base); */ -void __iomem *devm_ioremap_resource(struct device *dev, struct resource *res) +void __iomem *devm_ioremap_resource(struct device *dev, + const struct resource *res) { resource_size_t size; void __iomem *dest_ptr; -- 1.9.1