Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2368468imm; Mon, 24 Sep 2018 03:12:56 -0700 (PDT) X-Google-Smtp-Source: ACcGV61uk/tvPzm6XcaoMHgpDrBQ7q1gyT3yyCrjl8uK2VsD5ynjjkTGdlUAYXUYQn5bsqv4uooP X-Received: by 2002:a17:902:968d:: with SMTP id n13-v6mr9990581plp.33.1537783976449; Mon, 24 Sep 2018 03:12:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537783976; cv=none; d=google.com; s=arc-20160816; b=spCTGAuRIMuivIMqRmRhc7cHdopfEUHdZ1k9FjxAyYJIOZDNFJLtsKom1AOjVKAuk3 H9DbEnn/liO29hySRHJ0SKBdudCCwh3vVV4Gi4p/T4naiAfS1NlQL1zHS4ruCYFl7lLK xDRNvmNa6NXW110rJ7ggZkwXrjfwkPBgM5TkKOt4C3C2Fwh8cytaYvHHDwtOQ8IakeHZ H1AzT/LACcUcTTw3QYphmTaItkXy08NW0oWS9Xz+DSHpV7KNLrbkZCza1NGKro4AQRk8 tVjjP67l9I+LraL4cI7ZpqrOX9Pm5nYrfyKOjg6VdhaY8hKrdD+zvHeWk0+qJhtJdVgX DQ1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=38j/leseIFaYyx4yzFjMEUsIrw9mip1Szaiqm4tzm/A=; b=aNXryQI+uTGjJrgNc4TZFGTQNk8iqIQ2q2WuQu24R4r93EENW10Ke2zh1d240RQE4w 712BGq0I0mt3g2QEz19ZTfFkQFFLwebmY/ap77o4dGplXLl1ATKM7pDPIuZlSqOHkymW kRFTGX3dzeC+iKVhA6GvYGpmEr8j5X1cYRwdahTjpbkpgHg/I9liSxGoB1ZG2fOctp6k UrbF9HBT/ifvlVcOLm/50L1aCbtst3mAypFLz44SldB9Yg6NUx8AXEFDmO0gO3ykFg8P 7wedwm93UWpeNi4tiA/atr/fQzRldC07v6XfrAD0/1a7YhXafhSFUHEUjLun5X3200/i qViQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=Uy6pZDm6; 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 m63-v6si34052169pld.62.2018.09.24.03.12.41; Mon, 24 Sep 2018 03:12:56 -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; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=Uy6pZDm6; 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 S1728499AbeIXQNZ (ORCPT + 99 others); Mon, 24 Sep 2018 12:13:25 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:36992 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728059AbeIXQNY (ORCPT ); Mon, 24 Sep 2018 12:13:24 -0400 Received: by mail-wm1-f68.google.com with SMTP id n11-v6so9391022wmc.2 for ; Mon, 24 Sep 2018 03:12:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=38j/leseIFaYyx4yzFjMEUsIrw9mip1Szaiqm4tzm/A=; b=Uy6pZDm6z/fl0jre25cfBjomNanGjgb8D5SlflebK4Dq53aCng4x8B/xsSiEuoljv3 101hdyhZJRdiq1/LK2s2DYanexvieCFQqeRwuu5m3dGgKgsSIvaLaJ9FbXuS23DChcPW aDm6egXgtPBVwFwDkSDQTGokT7Umb7qL+Wkt2AWw+Vx87mWsKncg/A43TTnFs7BlHu2H f+AFCKKUZJ/eD5mpxpoIAwgmjfB6WAcqUVHtGVgTlElhqcRjB8HsJ5Y/78uN2J9xQgvL LHgVUwyoSq6yH00fcHDUwjZDzxbVDgVYVhRvJSbr2ctIuIsTIdtQpNX8YuDqVb+KWpUP LVHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=38j/leseIFaYyx4yzFjMEUsIrw9mip1Szaiqm4tzm/A=; b=UcYLLFh/3ywS98sIzRyn+soxYHxrSrbDEb41ZTOnzeaYYTiNgLaCxhlK0pr8Xgyzdy T0Jxo7Ki80OZqd52uIbRdieMmBLL3UJwrt73o/DzXAR0OduSDTMYCOGKapEyLOs6tD3q wLt6FMNHElxUsc1sTcV9CYecMDCSJ9iLsN2xfMZUDLApXgPlSUCoaq8UmBhG3fLy+nLh Pfm60aCB5VIJ3xkXw8GJLzBvmIMEuHJ/APqEy6fbsDpbgKZRx0uJH0bX2JnkWG6orAPm K00N9uiJJWMi2ZO1Gy8jz2zdZVjXdh3dyxHCEDeM94BUSRyrHOi7OS69O1WicbQSCr0I /Hyw== X-Gm-Message-State: ABuFfojnNFNC7I15wpa/kVrgRUdnGA6YQ8afIYSuj73elRryAt7CawGD iJMpHg41KpH9xFcckWfTjKJ8ew== X-Received: by 2002:a1c:4182:: with SMTP id o124-v6mr6764650wma.101.1537783923860; Mon, 24 Sep 2018 03:12:03 -0700 (PDT) Received: from brgl-bgdev.baylibre.local (AStLambert-681-1-2-33.w90-86.abo.wanadoo.fr. [90.86.1.33]) by smtp.gmail.com with ESMTPSA id o12-v6sm3291728wrj.58.2018.09.24.03.12.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Sep 2018 03:12:03 -0700 (PDT) From: Bartosz Golaszewski To: Michael Turquette , Stephen Boyd , Greg Kroah-Hartman , "Rafael J . Wysocki" , Arend van Spriel , Ulf Hansson , Bjorn Helgaas , Vivek Gautam , Robin Murphy , Joe Perches , Heikki Krogerus , Andrew Morton , Mike Rapoport , Michal Hocko , Al Viro , Jonathan Corbet , Roman Gushchin , Huang Ying , Kees Cook , Bjorn Andersson , Arnd Bergmann , Andy Shevchenko Cc: linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Bartosz Golaszewski Subject: [PATCH v3 1/4] devres: constify p in devm_kfree() Date: Mon, 24 Sep 2018 12:11:47 +0200 Message-Id: <20180924101150.23349-2-brgl@bgdev.pl> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180924101150.23349-1-brgl@bgdev.pl> References: <20180924101150.23349-1-brgl@bgdev.pl> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Reviewed-by: Bjorn Andersson --- 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