Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1414763pxb; Wed, 2 Feb 2022 04:36:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJwiiEcbIRjd9btzjzhRdDbdzR1E00GQBrttR+tuz4gju9cHECySCHm9TTTR5c0BjLQBEX23 X-Received: by 2002:aa7:81ce:: with SMTP id c14mr29112241pfn.2.1643805387300; Wed, 02 Feb 2022 04:36:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643805387; cv=none; d=google.com; s=arc-20160816; b=yroNBnHjTiE2ADIwCA3JozuWXCSIFQqMESKIdJ2BPFwjR0CJBm9eT8BpsX1f+Mno28 ZsoTpuXhMy+2wixSFgHI815Mj+6mnWFeRG30RYzJA0SkEsFgXvMj9kTj1XYjkQgf2nVF urZtWt7QyfmGLz5cSPv32T/iR0kj6Ebr9tC4ytZdpIClxypD6B+4qixHt3uwQBuemU5o DU0JqqZl1SVyceJ5gorCVMZvR2k1CjPKWIGHe2yeWPDa92Go1OvzMkc766GtWsm433Qj 1GqRgIgZGg0ni9X2Ao9Djrh7+pyeT5WdiEaTYtrArx5rFdhW/VlWxubZaEfYruX7jNPc hLVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:date:from:dkim-signature; bh=ul3s4D/Hp2YNz1ehPnbUO3CCYBCPQRY60603bZrCUHg=; b=NpIiBy13mARndRm2jpUWxqmorxZuo0ZM5oOnklvRK7KEVlv4GeN6qe7eEvDsjpOW54 sPH4K43iCQz+aE8f33+K7JfnKWNSQUzYnJR0XVK9+RHSGoXd594P9g5VK8zc4UT7J0lb JcyzEAqX6VHtvW8rIEBGreJiXjvlX1xBoa3FuMOz4/z5YDBoG0MHJNAxkKXtizw31jOZ dz5Ze9QXiykjbvChucpUnF5EVjhb8Vd4QUxBh1uNH/K0504esLO80+WHK/IGpaSgpsAf AUZyAtgyh0oEsvNluJmrogjicHb4qYbAM0T9erOc3Nc+fJeNh9B87Aw5uV+ApOwYVNv1 v07g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=maBdNT8J; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s127si547770pgs.683.2022.02.02.04.36.14; Wed, 02 Feb 2022 04:36:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=maBdNT8J; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235157AbiBAIaZ (ORCPT + 99 others); Tue, 1 Feb 2022 03:30:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231880AbiBAIaX (ORCPT ); Tue, 1 Feb 2022 03:30:23 -0500 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9D10C061714 for ; Tue, 1 Feb 2022 00:30:22 -0800 (PST) Received: by mail-lf1-x12d.google.com with SMTP id x23so32339864lfc.0 for ; Tue, 01 Feb 2022 00:30:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=ul3s4D/Hp2YNz1ehPnbUO3CCYBCPQRY60603bZrCUHg=; b=maBdNT8Jy5fUIq8duhY9BbnAsx1koD8nEsiEJgSxO0XEpcqUFAg6vcB7HRx58kKy+g v2LklwjvCMyJ1vY7gIHq8Ingp2/cKFo39Uzsz1I4fc7D2Q7S2M602gEcuGtxUBmJoYyN 8yBieWWGzUgHl7/oEhmUPM06duJsTiyvGV23N1S5CqQG2CkY1fvteCL+tjpbKvXxM0wJ g+3ePXlLizEmhwUT8Z5bKn21OejDfTshRhhrfuTa+Ksnn2yHLW3t1BYf5Z6ckxrfsqrE h5mPEv6Hu2ZzAzQtWCqvxA3NoZ1x787YQGY7RktTv2nU6IAUXVfIP44mbl2Fhyddtbym ufEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=ul3s4D/Hp2YNz1ehPnbUO3CCYBCPQRY60603bZrCUHg=; b=Mk1ygOC6H4XKpJAhdjWwV2jwVi5TMQ2a6XfTxobPvmq+wPiqqQoFssdPCa8ufA+ryh xrXDZ7fuT+RV1UMcFRHk3EX9Nwor/ZO0ttIG5W8q0qoloBcBNKANJdKh1O6h1n9Ik636 yHeITAsS6VGMh2Oz2N9UMzAvQgNVZ+0+jE1fECU2PwkS/VTsrKiOgl5gTK50cW/2Bdek t6a7+D1x5vsMohuDlu2Ve7z90kNkSJeHsbQNIJTG4HfzaARrx+6WoT7O+jwmAV78nKTA 8W9h7OPnbd3tvFjlQdbJ21RTl+aAC9Bc0UOm5S1SXL9DxxNxoIT5SkPOzuW+QmvVsaPz rvvg== X-Gm-Message-State: AOAM532oeO61aB4NxLk7XR7GuMu/PaZSTWZooo0B41zlSkKv2tgFQjYx 3dR4bk/wJjAhI379zGtCZVs= X-Received: by 2002:a19:6a12:: with SMTP id u18mr18232631lfu.348.1643704220935; Tue, 01 Feb 2022 00:30:20 -0800 (PST) Received: from pc638.lan ([155.137.26.201]) by smtp.gmail.com with ESMTPSA id q5sm3985122lfg.77.2022.02.01.00.30.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Feb 2022 00:30:20 -0800 (PST) From: Uladzislau Rezki X-Google-Original-From: Uladzislau Rezki Date: Tue, 1 Feb 2022 09:30:18 +0100 To: Jiapeng Chong Cc: akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Abaci Robot Subject: Re: [PATCH] mm/vmalloc.c: Fix "unused function" warning Message-ID: References: <20220129034652.75359-1-jiapeng.chong@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220129034652.75359-1-jiapeng.chong@linux.alibaba.com> 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. > Nit: vice versa? It is only used when 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 > Reviewed-by: Uladzislau Rezki (Sony) -- Vlad Rezki