Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2237549pxj; Sun, 30 May 2021 19:03:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxqJJPJRyUvzckRQg3o9qsMW65neMxSj8czx4EOdLonLA5smKlQnzYES+zafeXYXW+LJ/t6 X-Received: by 2002:a92:cd04:: with SMTP id z4mr14363887iln.39.1622426621042; Sun, 30 May 2021 19:03:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622426621; cv=none; d=google.com; s=arc-20160816; b=QJY8TCK8dRLZ6YR90cUjDUpDxvrqEjcPanfmSc2ikc193uZG1PDjARWAvd2q6Y1WhI 3Mwzb3Eef4dlzKKFtrvU8c4o5wHGQr5IwWBHSEEba6e+YMEvKKz4eyzDmM/5axCle5gw /wnPE7OxY0ejYRY2QyW719sllqGarh8kBZ8QQkORHbKXmGuMSMYw3+PgM/2v0EUd58ZT PTBej+PVcXFr7PqJ4dmQEY5l5Z6m9ZlxBh1gk3+TXBHMTAh9NMJrwsDUs16+6tg4B4xw 8mtSb314o6DeB1tCQVOPeCKFJQ3IhHiWjRfvAPUObBQVGgQmyJWHE8c+eQTxPzChuSoi BZdg== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=2Q8I/cC0qpb/aUVz8t8n7eOqgjvoGavTRPRf78kTwuA=; b=ieQ1WrSkClwRScg3z/oTgMS5Dv6qi4Fbm5QdqRg5++oYaJjZPAQDm+pcFNO3z/P9O5 ZUsMkMLfU6re+hdkiHMS0ywTR3HMx6M5NaoTyVAYPZ9SaScy7uIdOSrMchMxKEBWVuKj eOktBnOv+O1i0sDZ/Oq6Ltu4Bj6L+g1cEXZjFK9vUi2AHzMUlNiHhEycs3osx/PoHTIW DdWtKB8NWEcltx1d/4IE0Ayf4LyLa9fwYEpQn+TorbbzOeIZ+B/bQ8bUmGdOv1Fgy2ve MndV5zwiDkJQnCZ7jV01YoSHT//5Ulzo0pXFe4sOlp6jP/Ht9h2KOvECp1ziEiESnk6O WIog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=uzEG5j8X; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t2si9137689ilo.160.2021.05.30.19.03.28; Sun, 30 May 2021 19:03:41 -0700 (PDT) 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; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=uzEG5j8X; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230008AbhEaCE1 (ORCPT + 99 others); Sun, 30 May 2021 22:04:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229897AbhEaCEY (ORCPT ); Sun, 30 May 2021 22:04:24 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 73F39C061574 for ; Sun, 30 May 2021 19:02:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description; bh=2Q8I/cC0qpb/aUVz8t8n7eOqgjvoGavTRPRf78kTwuA=; b=uzEG5j8XFl4vDxy1sDXKFQaiNP j1Zo2I1m53vvefGy2jlC+JY10u+Vc1gV7O9d2UOnqOXMiK1FGt1NRhRArgGajx7W4MueEKKsSXHKJ UG5C3htzZd+JzKlrzIhi0e3AkSI1/9QXRvgwMU4C9vz1fmhI3LScrbomZmPudwIUjSFn2htvV/TL7 GmM3t8QIZOld3kl1qE116wh656TN2jfQYV2CVj2CW4wzZWd8XF+nzhMkyG/INLk8FztpGtEp3fSqE ql6+oQsVuKXGv/thG2HrbOnRjwCioWa59RLVZyNre0uoQbcdK1WE4yzS/rsfpGggvfI4xFIxXqT2Z XdgOy81w==; Received: from willy by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lnXG8-008Yid-R0; Mon, 31 May 2021 02:02:30 +0000 Date: Mon, 31 May 2021 03:02:28 +0100 From: Matthew Wilcox To: Bixuan Cui Cc: akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH -next] mm/mmap_lock: fix warning when CONFIG_TRACING is not defined Message-ID: References: <20210531015527.49785-1-cuibixuan@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210531015527.49785-1-cuibixuan@huawei.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 31, 2021 at 09:55:27AM +0800, Bixuan Cui wrote: > Fix the warning: [-Wunused-function] > mm/mmap_lock.c:157:20: warning: ‘get_mm_memcg_path’ defined but not used > static const char *get_mm_memcg_path(struct mm_struct *mm) > ^~~~~~~~~~~~~~~~~ That seems like the wrong way to fix the warning. Why not put it under an appropriate ifdef? > Signed-off-by: Bixuan Cui > --- > mm/mmap_lock.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/mmap_lock.c b/mm/mmap_lock.c > index 03ee85c696ef..ec7899b08690 100644 > --- a/mm/mmap_lock.c > +++ b/mm/mmap_lock.c > @@ -154,7 +154,7 @@ static inline void put_memcg_path_buf(void) > * The caller must call put_memcg_path_buf() once the buffer is no longer > * needed. This must be done while preemption is still disabled. > */ > -static const char *get_mm_memcg_path(struct mm_struct *mm) > +static const char __maybe_unused *get_mm_memcg_path(struct mm_struct *mm) > { > char *buf = NULL; > struct mem_cgroup *memcg = get_mem_cgroup_from_mm(mm); > -- > 2.17.1 > >