[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180925124629.20710-2-brgl@bgdev.pl>
Date: Tue, 25 Sep 2018 14:46:26 +0200
From: Bartosz Golaszewski <brgl@...ev.pl>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"Rafael J . Wysocki" <rafael@...nel.org>,
Jassi Brar <jassisinghbrar@...il.com>,
Thierry Reding <thierry.reding@...il.com>,
Jonathan Hunter <jonathanh@...dia.com>,
Arnd Bergmann <arnd@...db.de>,
Ulf Hansson <ulf.hansson@...aro.org>,
Rob Herring <robh@...nel.org>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Arend van Spriel <aspriel@...il.com>,
Robin Murphy <robin.murphy@....com>,
Vivek Gautam <vivek.gautam@...eaurora.org>,
Joe Perches <joe@...ches.com>,
Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Mike Rapoport <rppt@...ux.vnet.ibm.com>,
Roman Gushchin <guro@...com>, Michal Hocko <mhocko@...e.com>,
Huang Ying <ying.huang@...el.com>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Bjorn Andersson <bjorn.andersson@...aro.org>
Cc: linux-kernel@...r.kernel.org, linux-tegra@...r.kernel.org,
linux-arch@...r.kernel.org, linux-mm@...ck.org,
Bartosz Golaszewski <brgl@...ev.pl>
Subject: [PATCH v4 1/4] devres: constify p in devm_kfree()
Make devm_kfree() signature uniform with that of kfree(). To avoid
compiler warnings: cast p to (void *) when calling devres_destroy().
Signed-off-by: Bartosz Golaszewski <brgl@...ev.pl>
Reviewed-by: Bjorn Andersson <bjorn.andersson@...aro.org>
---
drivers/base/devres.c | 5 +++--
include/linux/device.h | 2 +-
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/base/devres.c b/drivers/base/devres.c
index f98a097e73f2..438c91a43508 100644
--- a/drivers/base/devres.c
+++ b/drivers/base/devres.c
@@ -885,11 +885,12 @@ EXPORT_SYMBOL_GPL(devm_kasprintf);
*
* Free memory allocated with devm_kmalloc().
*/
-void devm_kfree(struct device *dev, void *p)
+void devm_kfree(struct device *dev, const void *p)
{
int rc;
- rc = devres_destroy(dev, devm_kmalloc_release, devm_kmalloc_match, p);
+ rc = devres_destroy(dev, devm_kmalloc_release,
+ devm_kmalloc_match, (void *)p);
WARN_ON(rc);
}
EXPORT_SYMBOL_GPL(devm_kfree);
diff --git a/include/linux/device.h b/include/linux/device.h
index 8f882549edee..33f7cb271fbb 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -692,7 +692,7 @@ static inline void *devm_kcalloc(struct device *dev,
{
return devm_kmalloc_array(dev, n, size, flags | __GFP_ZERO);
}
-extern void devm_kfree(struct device *dev, void *p);
+extern void devm_kfree(struct device *dev, const void *p);
extern char *devm_kstrdup(struct device *dev, const char *s, gfp_t gfp) __malloc;
extern void *devm_kmemdup(struct device *dev, const void *src, size_t len,
gfp_t gfp);
--
2.18.0
Powered by blists - more mailing lists