Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp50725pxb; Mon, 31 Jan 2022 14:59:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJzqyuSbvGmo2PNeztDnvyeojNhisuJGwUX3+Z1eZ0hh5Wx5MF8+F1O5XqUYptSjHE4nywQD X-Received: by 2002:a17:906:8a83:: with SMTP id mu3mr17838980ejc.699.1643669962596; Mon, 31 Jan 2022 14:59:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643669962; cv=none; d=google.com; s=arc-20160816; b=iia8Ki/66S6iOGNcZRTVzeoem8FXTR1f6AizPkQ91qcrCgxmdpJA+lI3b531+ExoJr /Jl7SghFK2gaod2tnQBDX+e2aYOMFAfWnsyvnvHKQ6jz/a8a80Eb8Hl21hku/l5/ZHHm hy7+yBCIe8qA7o+iLtIoFeka3rvjyJV/YtRJHw5oyZoqr2yxFPjbrms5fsPtEMLves4B PigP/Sa2adkrQF/uKCOs0txaUY8Y1h2Tcid4HGVs53K3UQ8tZx2tNnrvXvXTjLRwBXo4 RxyTfO81q3mfeDOVabxnr8qbQiojq4lrAoVzb0KTC3CtNMYE1O+u/xM/3Zcpj32rLpZ4 TzyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=WPB/OpBPs3GWSkmjCDsY8wkwMVWdegH1Ogt+p1P2fCM=; b=VPVOrxCcBik7+dJGun6gj8hxQN/6eey1FkYCdppBug0eVw59NNUahCSfw8QzFV0wwy Kc5SabeYILE3orX89LL5Hw3olRUUu1DgAsHYqZ0o8XImrjRfFj3NTBEkrm7tFbGKCvTI p+cg6MJ6NBAnAO1UbmdUqzzp/nuQX6WPhBQbRD2Msgi9Kfv5oFi24TnqgBHXC2Allnc4 jMEA7PftyF6TNyRHdlnL1r3V+3t3Jkkr5SPvWcEf0GMl8BzDvoZHSqesganfTw+QcCAf KjJ/Jy7SAiWu890EMYov5U5VAhQTO96fH36ki2mL2cnpOlsgpZn6j/ZaEm0VLCVxQbH7 YuZw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c20si8329411eds.546.2022.01.31.14.58.57; Mon, 31 Jan 2022 14:59:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352264AbiA2DrD (ORCPT + 99 others); Fri, 28 Jan 2022 22:47:03 -0500 Received: from out30-57.freemail.mail.aliyun.com ([115.124.30.57]:35881 "EHLO out30-57.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238931AbiA2DrB (ORCPT ); Fri, 28 Jan 2022 22:47:01 -0500 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 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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) { -- 2.20.1.7.g153144c