From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E37A4C47092 for ; Mon, 31 May 2021 02:02:43 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C098D610C8 for ; Mon, 31 May 2021 02:02:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C098D610C8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 069CB6B0036; Sun, 30 May 2021 22:02:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 01A388D0002; Sun, 30 May 2021 22:02:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E4BF86B0070; Sun, 30 May 2021 22:02:41 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0157.hostedemail.com [216.40.44.157]) by kanga.kvack.org (Postfix) with ESMTP id AFE386B0036 for ; Sun, 30 May 2021 22:02:41 -0400 (EDT) Received: from smtpin32.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 434C8180373EB for ; Mon, 31 May 2021 02:02:41 +0000 (UTC) X-FDA: 78199877322.32.6C696C3 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf10.hostedemail.com (Postfix) with ESMTP id 383AC4202A07 for ; Mon, 31 May 2021 02:02:30 +0000 (UTC) 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 In-Reply-To: <20210531015527.49785-1-cuibixuan@huawei.com> Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=uzEG5j8X; dmarc=none; spf=none (imf10.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org X-Stat-Signature: g1iasrafc3gczuwzc5o8by9fz7jar96b X-Rspamd-Queue-Id: 383AC4202A07 X-Rspamd-Server: rspam02 X-HE-Tag: 1622426550-728781 Content-Transfer-Encoding: quoted-printable 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: 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: =E2=80=98get_mm_memcg_path=E2=80=99 def= ined 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(-) >=20 > 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 lon= ger > * 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 =3D NULL; > struct mem_cgroup *memcg =3D get_mem_cgroup_from_mm(mm); > --=20 > 2.17.1 >=20 >=20