Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp91168ybl; Thu, 12 Dec 2019 14:36:43 -0800 (PST) X-Google-Smtp-Source: APXvYqxbCh2/VMzEF1fvY9kK0X5M6bY2MN2U16/GCTVQfYCdSjqkYeRcJ7H3RKtU8f61714r9DRP X-Received: by 2002:a9d:7342:: with SMTP id l2mr10821009otk.98.1576190203111; Thu, 12 Dec 2019 14:36:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576190203; cv=none; d=google.com; s=arc-20160816; b=tlgSqaG9Y46RUnAVWFQm/xbrczL6/xhTQ6YiZaZSsp21xL0XaAOa+okgoQd26UWlXB Cl1MOQh20lUI041OK/o4AoCEaS3gI7uzbnxmdz9DDko14UYYjoZgHVXuFX+kh0G4SFc5 wmoCWs0wa03n3uZ2iqB06vQnJ+m4Y9KkP1UI8XsDa0zi1CSQeIardiX3Ya8WQ76s5Wb/ krJRndqt9YXJLcjzjuLM/MywQogsV/CFLP7Fw9DpRyuMBU2pFndnEPL3hMA8Eo1C7/OF EvWpXaeYoe2l/Ht24YuHBSGmzMiiK03Eff9KFVWXu3fzCloP5Fa476GJArTGc64ijGlx 7Ypg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=VQEfz+Cy5EaVmD34zXdfkm+5gm7kX4L6adU85LqBrEU=; b=w8e3lIegNmF0z7vBmhHfqQfj1q3r/LtJ519Big4XRGxuconFqtwOzNPnOYwnAUADZz uVK/Ch65j6qTtkJ/MzH6Szho7XSu+CCaphpVd3ENTkLjDO5ZbVafFmJ2tWfPaSXqREEh 2ikVPU7PtHohLpwsYMjCsubmF2X+QBraSw7WvP2xos7OY0vSFNKu5vIPQKcQVQfPORLD vvcoxsNBLRzxCSh2H8e0vb79mPv9DkHrxules5uVmta7NprrJYbgiOtRU0sWkr0OsIhR HlH9rE3K4LIyyQZHYdi6o4AY5FdbwmQCilA2S8uQk5Hn3JZPylOOHsC3RchFd2WedhSS SjGA== ARC-Authentication-Results: i=1; mx.google.com; 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 v18si4392879oic.27.2019.12.12.14.36.31; Thu, 12 Dec 2019 14:36:43 -0800 (PST) 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; 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 S1731034AbfLLWfE (ORCPT + 99 others); Thu, 12 Dec 2019 17:35:04 -0500 Received: from Chamillionaire.breakpoint.cc ([193.142.43.52]:37158 "EHLO Chamillionaire.breakpoint.cc" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730921AbfLLWfE (ORCPT ); Thu, 12 Dec 2019 17:35:04 -0500 Received: from fw by Chamillionaire.breakpoint.cc with local (Exim 4.92) (envelope-from ) id 1ifX2s-0007l2-Ey; Thu, 12 Dec 2019 23:34:54 +0100 From: Florian Westphal To: linux-mm@kvack.org Cc: cl@linux.com, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, akpm@linux-foundation.org, linux-kernel@vger.kernel.org, Florian Westphal Subject: [PATCH] mm: remove __krealloc Date: Thu, 12 Dec 2019 23:34:42 +0100 Message-Id: <20191212223442.22141-1-fw@strlen.de> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since 5.5-rc1 the last user of this function is gone, so remove the functionality. See commit 2ad9d7747c10 ("netfilter: conntrack: free extension area immediately") for details. Signed-off-by: Florian Westphal --- include/linux/slab.h | 1 - mm/slab_common.c | 22 ---------------------- scripts/coccinelle/free/devm_free.cocci | 4 ---- 3 files changed, 27 deletions(-) diff --git a/include/linux/slab.h b/include/linux/slab.h index 877a95c6a2d2..03a389358562 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h @@ -184,7 +184,6 @@ void memcg_deactivate_kmem_caches(struct mem_cgroup *, struct mem_cgroup *); /* * Common kmalloc functions provided by all allocators */ -void * __must_check __krealloc(const void *, size_t, gfp_t); void * __must_check krealloc(const void *, size_t, gfp_t); void kfree(const void *); void kzfree(const void *); diff --git a/mm/slab_common.c b/mm/slab_common.c index f0ab6d4ceb4c..87e8923cf0b6 100644 --- a/mm/slab_common.c +++ b/mm/slab_common.c @@ -1675,28 +1675,6 @@ static __always_inline void *__do_krealloc(const void *p, size_t new_size, return ret; } -/** - * __krealloc - like krealloc() but don't free @p. - * @p: object to reallocate memory for. - * @new_size: how many bytes of memory are required. - * @flags: the type of memory to allocate. - * - * This function is like krealloc() except it never frees the originally - * allocated buffer. Use this if you don't want to free the buffer immediately - * like, for example, with RCU. - * - * Return: pointer to the allocated memory or %NULL in case of error - */ -void *__krealloc(const void *p, size_t new_size, gfp_t flags) -{ - if (unlikely(!new_size)) - return ZERO_SIZE_PTR; - - return __do_krealloc(p, new_size, flags); - -} -EXPORT_SYMBOL(__krealloc); - /** * krealloc - reallocate memory. The contents will remain unchanged. * @p: object to reallocate memory for. diff --git a/scripts/coccinelle/free/devm_free.cocci b/scripts/coccinelle/free/devm_free.cocci index 441799b5359b..66aaf68889a5 100644 --- a/scripts/coccinelle/free/devm_free.cocci +++ b/scripts/coccinelle/free/devm_free.cocci @@ -94,8 +94,6 @@ position p; kfree@p(x) | kzfree@p(x) -| - __krealloc@p(x, ...) | krealloc@p(x, ...) | @@ -120,8 +118,6 @@ position p != safe.p; | * kzfree@p(x) | -* __krealloc@p(x, ...) -| * krealloc@p(x, ...) | * free_pages@p(x, ...) -- 2.23.0