Commit 0571967d authored by Bartosz Golaszewski's avatar Bartosz Golaszewski Committed by Greg Kroah-Hartman

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: default avatarBartosz Golaszewski <brgl@bgdev.pl>
Reviewed-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
Reviewed-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Acked-by: default avatarRasmus Villemoes <linux@rasmusvillemoes.dk>
Reviewed-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 8514c470
...@@ -885,11 +885,12 @@ EXPORT_SYMBOL_GPL(devm_kasprintf); ...@@ -885,11 +885,12 @@ EXPORT_SYMBOL_GPL(devm_kasprintf);
* *
* Free memory allocated with devm_kmalloc(). * 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; 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); WARN_ON(rc);
} }
EXPORT_SYMBOL_GPL(devm_kfree); EXPORT_SYMBOL_GPL(devm_kfree);
......
...@@ -694,7 +694,7 @@ static inline void *devm_kcalloc(struct device *dev, ...@@ -694,7 +694,7 @@ static inline void *devm_kcalloc(struct device *dev,
{ {
return devm_kmalloc_array(dev, n, size, flags | __GFP_ZERO); 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 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, extern void *devm_kmemdup(struct device *dev, const void *src, size_t len,
gfp_t gfp); gfp_t gfp);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment