From patchwork Thu Dec 12 22:34:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Westphal X-Patchwork-Id: 11289477 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 47D20109A for ; Thu, 12 Dec 2019 22:35:00 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1F4CF206A5 for ; Thu, 12 Dec 2019 22:35:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1F4CF206A5 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=strlen.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 424E78E0006; Thu, 12 Dec 2019 17:34:59 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 3D6738E0001; Thu, 12 Dec 2019 17:34:59 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 313658E0006; Thu, 12 Dec 2019 17:34:59 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0132.hostedemail.com [216.40.44.132]) by kanga.kvack.org (Postfix) with ESMTP id 1D6958E0001 for ; Thu, 12 Dec 2019 17:34:59 -0500 (EST) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with SMTP id CE28D49960B for ; Thu, 12 Dec 2019 22:34:58 +0000 (UTC) X-FDA: 76257945876.17.cakes36_e4fb06ee3721 X-Spam-Summary: 2,0,0,b8cbab4539bc4f67,d41d8cd98f00b204,fw@breakpoint.cc,::cl@linux.com:penberg@kernel.org:rientjes@google.com:iamjoonsoo.kim@lge.com:akpm@linux-foundation.org:linux-kernel@vger.kernel.org:fw@strlen.de,RULES_HIT:41:69:355:379:541:800:960:966:968:973:982:988:989:1260:1311:1314:1345:1437:1515:1534:1542:1711:1730:1747:1777:1792:1801:2194:2196:2198:2199:2200:2201:2393:2559:2562:2693:3138:3139:3140:3141:3142:3354:3865:3866:3867:3870:3871:3872:3873:4321:4385:4605:5007:7875:7903:7904:9592:10004:11026:11473:11658:11914:12043:12160:12219:12296:12297:12438:12555:12895:12986:13141:13230:13894:14093:14096:14181:14394:14721:21080:21451:21627:21740:21795:21990:30051:30054:30074:30091,0,RBL:193.142.43.52:@breakpoint.cc:.lbl8.mailshell.net-62.14.6.100 64.201.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:25,LUA_SUMMARY:none X-HE-Tag: cakes36_e4fb06ee3721 X-Filterd-Recvd-Size: 3369 Received: from Chamillionaire.breakpoint.cc (Chamillionaire.breakpoint.cc [193.142.43.52]) by imf22.hostedemail.com (Postfix) with ESMTP for ; Thu, 12 Dec 2019 22:34:58 +0000 (UTC) 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 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 Reviewed-by: David Hildenbrand Acked-by: David Rientjes --- 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, ...)