From patchwork Tue Aug 28 09:33:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 10578099 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id ADF10920 for ; Tue, 28 Aug 2018 09:41:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9F781299F4 for ; Tue, 28 Aug 2018 09:41:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9294429A0C; Tue, 28 Aug 2018 09:41:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4864C299F4 for ; Tue, 28 Aug 2018 09:41:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727210AbeH1Ncb (ORCPT ); Tue, 28 Aug 2018 09:32:31 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:35597 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727130AbeH1Ncb (ORCPT ); Tue, 28 Aug 2018 09:32:31 -0400 Received: by mail-wm0-f67.google.com with SMTP id o18-v6so1298219wmc.0 for ; Tue, 28 Aug 2018 02:41:41 -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=SVWcFbk/dVzlsS+UwHvhPxvTnIJPJG8C6MWyhlzaJP4=; b=TjY7XD59PXtSvVirztIUG/IzfuDVWIiYSDoXxS4NQ4F2s7v5QZzehTI9rlcKQKQmHC S7Wfo/sISESMCfGCmTz8pBDEpoKRlEvMSySpNcKszz/mSeCD6r3ZYQqh7NS42cCUrTUl ohCflbE1aFg6Cg8i4w7T4tUE1hRO4ML0HDDYDXlYX3s/sM/60rqYtpraEcXbn7VFpFsI Rf13u+/Ix6L/8VCcE26REBhIMzh4gODasHflNG5XY4jsGkCfFaneUEaxxPeL1JAmVr33 4agPt2IlxFibmgO36O4hLogKoEqwoSfDEogM+joTQ4uEDhYEWBHeY58XBOHgpQLO+h8I Ngjw== 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=SVWcFbk/dVzlsS+UwHvhPxvTnIJPJG8C6MWyhlzaJP4=; b=ArBIyFRl96pNZ3NrRl97io0qr4Ncdtc5H2WeZy8iGV0yA3Vo3zkEYjRzcL2w3pUiEx utusUYsOCTFwzFiJ8kzFxYC1WQREqdSPbebkjxg4DqcBFvciuE83VvArhw442CPBI1VC T9IaQMqpUm8gMVT2LhTM/XCcyzaxQIRh+oU9GIw/K2BjdgWKJmPpZI7lgArg+hEHpBtl 4VDkT6k1DAh2N75ARYIEV1Px2KiZGeizhiAHJ88O0B5okTKabGiuJVpepeyI6a+0vRm6 I0jqm3nvVdSd7qxTU+pp9vZud0BWAalg+xwQ1W/RjE8UjO6jVwfT2Hq0BJ0gUnfh5A1X yGvA== X-Gm-Message-State: APzg51AVUcEfFYYwgMiCeH2cVxuRDZjLSJUWIKApRzNNN1u3LfKci/Wd P7DEyg3UfJosEgUKu/aIRakFJA== X-Google-Smtp-Source: ANB0VdaV9Pzpww2Wl5G6NP9NsWTUDI9DTePHGQQs1BV4TSeNoZ3PsHOAKQ3DK7ioV0EeP/SgV6txyQ== X-Received: by 2002:a1c:b213:: with SMTP id b19-v6mr759080wmf.141.1535448846439; Tue, 28 Aug 2018 02:34:06 -0700 (PDT) Received: from brgl-bgdev.home ([2a01:cb1d:af:5b00:e837:b8d5:48c1:571b]) by smtp.gmail.com with ESMTPSA id l18-v6sm952276wru.75.2018.08.28.02.34.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Aug 2018 02:34:05 -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 Cc: linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Bartosz Golaszewski Subject: [PATCH v2 1/4] devres: constify p in devm_kfree() Date: Tue, 28 Aug 2018 11:33:29 +0200 Message-Id: <20180828093332.20674-2-brgl@bgdev.pl> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180828093332.20674-1-brgl@bgdev.pl> References: <20180828093332.20674-1-brgl@bgdev.pl> Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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);