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=-5.5 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no 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 695A2C433E1 for ; Tue, 14 Jul 2020 13:33:49 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DE94B22280 for ; Tue, 14 Jul 2020 13:33:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DE94B22280 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 570256B0003; Tue, 14 Jul 2020 09:33:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 520116B0006; Tue, 14 Jul 2020 09:33:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 436066B0007; Tue, 14 Jul 2020 09:33:48 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0114.hostedemail.com [216.40.44.114]) by kanga.kvack.org (Postfix) with ESMTP id 29E416B0003 for ; Tue, 14 Jul 2020 09:33:48 -0400 (EDT) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 9C61B2DFD for ; Tue, 14 Jul 2020 13:33:47 +0000 (UTC) X-FDA: 77036774094.20.honey63_0f10fa226ef1 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin20.hostedemail.com (Postfix) with ESMTP id 345D5180C061E for ; Tue, 14 Jul 2020 13:33:46 +0000 (UTC) X-HE-Tag: honey63_0f10fa226ef1 X-Filterd-Recvd-Size: 2359 Received: from huawei.com (szxga06-in.huawei.com [45.249.212.32]) by imf14.hostedemail.com (Postfix) with ESMTP for ; Tue, 14 Jul 2020 13:33:45 +0000 (UTC) Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 1058AA0EF0DC88216259; Tue, 14 Jul 2020 21:33:36 +0800 (CST) Received: from [127.0.0.1] (10.174.179.238) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.487.0; Tue, 14 Jul 2020 21:33:30 +0800 Subject: Re: [PATCH] mm/percpu: mark pcpu_chunk_type() as __maybe_unused To: Stephen Rothwell CC: , , , , , Roman Gushchin References: <20200714134101.80534-1-cuibixuan@huawei.com> <20200714225311.7aeffffd@canb.auug.org.au> From: Bixuan Cui Message-ID: Date: Tue, 14 Jul 2020 21:33:29 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <20200714225311.7aeffffd@canb.auug.org.au> Content-Type: text/plain; charset="utf-8" Content-Language: en-US X-Originating-IP: [10.174.179.238] X-CFilter-Loop: Reflected X-Rspamd-Queue-Id: 345D5180C061E X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam02 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 2020/7/14 20:53, Stephen Rothwell wrote: > Hi Bixuan, >=20 > On Tue, 14 Jul 2020 13:41:01 +0000 Bixuan Cui wr= ote: >> Gcc report the following warning without CONFIG_MEMCG_KMEM: >> >> mm/percpu-internal.h:145:29: warning: =E2=80=98pcpu_chunk_type=E2=80=99= defined >> but not used [-Wunused-function] >> static enum pcpu_chunk_type pcpu_chunk_type(struct pcpu_chunk *chunk) >> ^~~~~~~~~~~~~~~ >> >> Mark pcpu_chunk_type() as __maybe_unused to make it clear. > Given that it is in a header file, it should probably just be "static > inline" (which will also suppress the warning). As should > pcpu_is_memcg_chunk() and pcpu_chunk_list(). Also, without them being > inline, there will be a new copy for each file that > mm/percpu-internal.h is included in. >=20 > And that should be considered a fix for "mm: memcg/percpu: account > percpu memory to memory cgroups". Thinks=EF=BC=8Ci will fix it.