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 <[email protected]>
Reviewed-by: Bjorn Andersson <[email protected]>
Reviewed-by: Geert Uytterhoeven <[email protected]>
Acked-by: Rasmus Villemoes <[email protected]>
Reviewed-by: Andy Shevchenko <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
Bartosz Golaszewski 2018-10-14 17:20:07 +02:00 • committed by Greg Kroah-Hartman
commit 0571967dfb
2 changed files with 4 additions and 3 deletions

View file

@ -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);