Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp294477ybm; Thu, 28 May 2020 02:59:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz9y2a5WGn/0/oHSLAXo/z5v9M3LYFyGlGgTvLeG34eSTeXF8vJRmkORQYcsqgeFV7iUsmW X-Received: by 2002:aa7:da46:: with SMTP id w6mr1030493eds.31.1590659962744; Thu, 28 May 2020 02:59:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590659962; cv=none; d=google.com; s=arc-20160816; b=d62cUCWngzDkXM0RyQ9LZT9/GaxpNJvQ9qTlUCwEGGxjNwJkwM5VGOO7yup6uTkdj2 xfSfQWQy/r/kSXOgo/ZtMncu/jDYwl1k8J7vVp+zubn4Q+ejzx/XkIFFvnszLqyomyvU DYKUGJUVSsTXT6SLHXYea+rMMDYxvLbTCfoj0qvjjOIsQrxHcnk0APr0lEcWZDJ4NOkN KvLSChLHZebkGwFgtsBghqhxWw151xTPDXoncKNdm/d0z09SDGJsg2Eok+1byFOcWp9N DQxbA842DEbe18Swmn1u4G1eJl0apCjjWi3pzl8QPF1uJR/24Yp9jPI+FP2/0jonoOYp zd6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=YcQjrXhb9JyLYQEICs7WUjRHYBxG2qx/p7xuKFVEyug=; b=mmPsmUeHz6Qb/275vuDO0gxG95eTaBTndwirLQo4JDe39rosijcT3Bd00t2KC1wo4w 8CY7OxD2uQucgTZu002DQrreufi3NizwdTf/2LxwJ2v+iGr78MTP3qDGP6ah0wjI8bA7 9qb7QB/CLp0cRCb7VNXf0yMvWY/BEQ9xYEX0bofZ3zMEyJo4dQwT4BuzXvATTOi6Wj6m caUMdPGFAk9LgCHUXsHWHzcFjI2gIT5bHpsz/TVIr6F6Bkcw0LGd58i4+6PytPTFhq4g rOzymRWEg1wgtBPt6Z0WPIz19QJSwWptKfZJJ1TYZTbbc89tpJhazbOlBrGX8USR8Av/ rZYg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e3si3023493edq.595.2020.05.28.02.58.59; Thu, 28 May 2020 02:59:22 -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; 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 S2387585AbgE1J5L (ORCPT + 99 others); Thu, 28 May 2020 05:57:11 -0400 Received: from mout.kundenserver.de ([212.227.126.133]:47511 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387432AbgE1J5L (ORCPT ); Thu, 28 May 2020 05:57:11 -0400 Received: from threadripper.lan ([149.172.98.151]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.129]) with ESMTPA (Nemesis) id 1MPGJh-1jNYOn19Pp-00Pco1; Thu, 28 May 2020 11:56:44 +0200 From: Arnd Bergmann To: Johannes Weiner , Michal Hocko , Vladimir Davydov , Andrew Morton , Stephen Rothwell , Joonsoo Kim Cc: Arnd Bergmann , Alex Shi , Hugh Dickins , "Kirill A. Shutemov" , Michal Hocko , Roman Gushchin , Shakeel Butt , Balbir Singh , Chris Down , Yafang Shao , Tejun Heo , cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH] mm: memcontrol: fix an unused-function warning Date: Thu, 28 May 2020 11:56:26 +0200 Message-Id: <20200528095640.151454-1-arnd@arndb.de> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K1:MmnweMcrIlQS31C4Eojn+fisoHH6xccQrSm5HEQ7Cg4yek9PYGC +ghSiDQyJqsxnlMJfWbmBK2Qu6dq6unBLwpvZ0yHILOPW/ria1qeOlXncbIGyYc5lvWAzZ1 7GmpBcr+r0Cnb3BVV8dej8SDqtMZZYqtv6KdgWZ0SpUaVNyg1GdFQXpiM62/hST9SV3t5jh PRjOjacy/S1rObEnr+NBA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:Tt63NLnuUFg=:a9faJh4it/EFiD6fj/M/gH t2D0WyESVdFmjjor8z9UwmI7Q+RS2KcFEZzAL6ThJP0jbq1dtr08eDCfcLfoZewsKiENs5HGs f904rkJoqqc9tDLq2ebhaa2vyAdXxJXL7AwR7Yn7niUqSGwg+BGvh41903eG5wyEPK1QjfjEl t7SnlC3ZXpH6Ce/fcLrYSgu5JNSt3BBttO6XHI7hluh6+4gKyezMJ1F7TtALflb7k+6bCGqah hyy/XZSz50UeCny1mM63SE/grrMlyggkSWzQGqRQQQ5C/noZKGnZTojlSKKDMe1Kx46OlLxgf aR1QJvSnQG9yM2zdoYpb0qGCZXHzz6k9rwD7FNu0Ydnd5eLbCXuD3H/T6zn5/zYtpsYRq7osQ IRvYYuSrabVOdOSk7VyKYn4B7+Jyktf0mWo3AwmByDaUiLDM23iUWYD06tk1d25TbsEuYG0G4 daI/VBZTJLAEHYMR5JDkVI20cq5LX26WTN8RWnq3eFcobjBn7+wUhO88U0bkc5vQGvgf+tcNV TcZQoQ50WncZArEdeBiE7+Ukn1NgRl/Z5WRuHphG9OZtAbHl9YNOyGxWauVlq+MtUASFw4fvC go/YA8vF2ZSp1pj9J+jsumw5JcuUeGSsxnM1LKxOHn8qcnoA6cGg29cbXnOxvu470Lu+Je9eg UKEJPfAFwqtM6OVmaBo0t/2uSmHGMOmZaXukJvKJh39tp4UD9m3+msIM4PAmMWLoa0MqHCR/7 GivQCT+5COGnL9/9d4eCoo+xGlF+TXYfJiFmie0eElWHsdzkKqP4GVBCb5k3uPvs2M/pvYNEc xJbZdSxQZf/3Zot/JszCFO0aN3yBf9Fw3pb91iw7CtSpsMjlkw= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On NOMMU kernels without CONFIG_MEMCG_KMEM, we now get a harmless warning about an unused function: mm/memcontrol.c:2595:13: error: unused function 'cancel_charge' [-Werror,-Wunused-function] Hide this function in a matching #ifdef. Fixes: 5bd144bf764c ("mm: memcontrol: drop unused try/commit/cancel charge API") Signed-off-by: Arnd Bergmann --- mm/memcontrol.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index f14da7a7348b..7bfca0abb8e1 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -2592,6 +2592,7 @@ static int try_charge(struct mem_cgroup *memcg, gfp_t gfp_mask, return 0; } +#if defined(CONFIG_MEMCG_KMEM) || defined(CONFIG_MMU) static void cancel_charge(struct mem_cgroup *memcg, unsigned int nr_pages) { if (mem_cgroup_is_root(memcg)) @@ -2603,6 +2604,7 @@ static void cancel_charge(struct mem_cgroup *memcg, unsigned int nr_pages) css_put_many(&memcg->css, nr_pages); } +#endif static void commit_charge(struct page *page, struct mem_cgroup *memcg) { -- 2.26.2