From patchwork Sat Jan 29 03:46:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiapeng Chong X-Patchwork-Id: 12729381 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5AD10C433FE for ; Sat, 29 Jan 2022 03:47:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C53AD6B00C4; Fri, 28 Jan 2022 22:47:04 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C02756B00C7; Fri, 28 Jan 2022 22:47:04 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AF0FE6B00CB; Fri, 28 Jan 2022 22:47:04 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0181.hostedemail.com [216.40.44.181]) by kanga.kvack.org (Postfix) with ESMTP id 9BB306B00C4 for ; Fri, 28 Jan 2022 22:47:04 -0500 (EST) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 47E2B95C8A for ; Sat, 29 Jan 2022 03:47:04 +0000 (UTC) X-FDA: 79081938768.13.6EB4CD3 Received: from out30-42.freemail.mail.aliyun.com (out30-42.freemail.mail.aliyun.com [115.124.30.42]) by imf15.hostedemail.com (Postfix) with ESMTP id 2B0A4A0006 for ; Sat, 29 Jan 2022 03:47:02 +0000 (UTC) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R671e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04395;MF=jiapeng.chong@linux.alibaba.com;NM=1;PH=DS;RN=5;SR=0;TI=SMTPD_---0V35.M-4_1643428014; Received: from localhost(mailfrom:jiapeng.chong@linux.alibaba.com fp:SMTPD_---0V35.M-4_1643428014) by smtp.aliyun-inc.com(127.0.0.1); Sat, 29 Jan 2022 11:47:00 +0800 From: Jiapeng Chong To: akpm@linux-foundation.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Jiapeng Chong , Abaci Robot Subject: [PATCH] mm/vmalloc.c: Fix "unused function" warning Date: Sat, 29 Jan 2022 11:46:52 +0800 Message-Id: <20220129034652.75359-1-jiapeng.chong@linux.alibaba.com> X-Mailer: git-send-email 2.20.1.7.g153144c MIME-Version: 1.0 X-Rspamd-Queue-Id: 2B0A4A0006 X-Rspam-User: nil Authentication-Results: imf15.hostedemail.com; dkim=none; spf=pass (imf15.hostedemail.com: domain of jiapeng.chong@linux.alibaba.com designates 115.124.30.42 as permitted sender) smtp.mailfrom=jiapeng.chong@linux.alibaba.com; dmarc=pass (policy=none) header.from=alibaba.com X-Stat-Signature: 7xkjk9i9e9on1a9i8s6mjxiwz45rnnmk X-Rspamd-Server: rspam08 X-HE-Tag: 1643428022-138334 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000311, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: compute_subtree_max_size() is unused, when building with DEBUG_AUGMENT_PROPAGATE_CHECK=y. mm/vmalloc.c:785:1: warning: unused function 'compute_subtree_max_size' [-Wunused-function]. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong Reviewed-by: Uladzislau Rezki (Sony) --- mm/vmalloc.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 028ce2b9bbf9..42d37b4bd351 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -778,17 +778,6 @@ get_subtree_max_size(struct rb_node *node) return va ? va->subtree_max_size : 0; } -/* - * Gets called when remove the node and rotate. - */ -static __always_inline unsigned long -compute_subtree_max_size(struct vmap_area *va) -{ - return max3(va_size(va), - get_subtree_max_size(va->rb_node.rb_left), - get_subtree_max_size(va->rb_node.rb_right)); -} - RB_DECLARE_CALLBACKS_MAX(static, free_vmap_area_rb_augment_cb, struct vmap_area, rb_node, unsigned long, subtree_max_size, va_size) @@ -978,6 +967,17 @@ unlink_va(struct vmap_area *va, struct rb_root *root) } #if DEBUG_AUGMENT_PROPAGATE_CHECK +/* + * Gets called when remove the node and rotate. + */ +static __always_inline unsigned long +compute_subtree_max_size(struct vmap_area *va) +{ + return max3(va_size(va), + get_subtree_max_size(va->rb_node.rb_left), + get_subtree_max_size(va->rb_node.rb_right)); +} + static void augment_tree_propagate_check(void) {