From patchwork Wed Aug 24 08:22:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 101945 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp193349qga; Wed, 24 Aug 2016 01:24:22 -0700 (PDT) X-Received: by 10.98.100.67 with SMTP id y64mr3399634pfb.84.1472027062138; Wed, 24 Aug 2016 01:24:22 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ih4si8479722pab.275.2016.08.24.01.24.21; Wed, 24 Aug 2016 01:24:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754809AbcHXIYS (ORCPT + 27 others); Wed, 24 Aug 2016 04:24:18 -0400 Received: from mout.kundenserver.de ([212.227.126.130]:59394 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754051AbcHXIXW (ORCPT ); Wed, 24 Aug 2016 04:23:22 -0400 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue001) with ESMTPA (Nemesis) id 0MZ5db-1bh68u1Ewt-00ViPj; Wed, 24 Aug 2016 10:23:07 +0200 From: Arnd Bergmann To: Vladimir Davydov Cc: Arnd Bergmann , Johannes Weiner , Michal Hocko , Andrew Morton , Tejun Heo , Mel Gorman , cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH] mm: memcontrol: avoid unused function warning Date: Wed, 24 Aug 2016 10:22:43 +0200 Message-Id: <20160824082301.632345-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:YyW+ArXvAYLtKrH6A7QrwtyvmEJwMXFA9iDHXl1IwVQoXxI/lEh vhKIPYToCl5zZRSIXW+lBloNZHgvZXb3UU52KWeFBtJ6znxa+hW8CD6i4unF+WGCMR73qfx 2XoOJuxzoDWfT0D+mkDxjqloQaME+4NxxFKcAJb6y1Q60CANPlumH11+CINXM8YxkbvMwoP f2GJaqEfFCcffgiNvhc4Q== X-UI-Out-Filterresults: notjunk:1; V01:K0:sb2wvrLdAig=:lHI7lorbwM6MA7x5eOhqEf D2xgP/Ki2kdKgEzHG49AGRcmaoiO+CGiJfY9xK6sWMALttQA0EVrTXviMKM8xKYDkWiTR8I9e WkyuFMzcoaTLNM0ruNaDBYGi12EmzCvv935AG+kiGCDrtu7TC+/NHEdeehyFXfnllb1pYB3kA 5kW3QyFLf3xdOKLSL9k2C6h6KIAbwRJXrX46IbrtMWMqKzC7lD1O7iRZIr5nuz8qlmjnmpFEX CQ3rkrohDjOxYZsUJlUmnmulp4EBwSQ56KkK0J59hyHDfV5d4vGL2jb7DKB2CsigLeYxpFaBS O8mx/LuIAkkPunrCHq2jyj0zw0GX6BPsPn+CKYQKfrgfzzFT9ZV4Zk10L5qW0ZQJXNp0xjf0K WHiVKOfFTQROqgG3CtQN5JVmx8AFXvARc4mhIJj/lomGBnIvgPU4TfQpxjnmUJ5pH7eLdYIO3 9MSlJjMiDv6fCAE9skhXMew04bX754TYCtK5+wk9/pcvaJl7VAlTBGcQ2mh54n34fOeCh2R/0 BlGt4+e0I3h7pJMicx51cghIxV5pBC7hUpBJscvEpABLp9VvX7b6ydLi4WlvphOdi56rzK8R6 vKR2rSK+ZtH/kHeY1wtokwE6crJ0suWJdQwn2UTZKvUawVi222IrNliz8PF/KNl0w8lfee6xG KhS8ecqot7/3WS/6QRwb9DZVeEvQmMXAeU2PJFrAO9uQf+0AxIc3CbQNcY04AfGM9jhI= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org A bugfix in v4.8-rc2 introduced a harmless warning when CONFIG_MEMCG_SWAP is disabled but CONFIG_MEMCG is enabled: mm/memcontrol.c:4085:27: error: 'mem_cgroup_id_get_online' defined but not used [-Werror=unused-function] static struct mem_cgroup *mem_cgroup_id_get_online(struct mem_cgroup *memcg) This adds an extra #ifdef that matches the one around the caller to avoid the warning. Signed-off-by: Arnd Bergmann Fixes: 1f47b61fb407 ("mm: memcontrol: fix swap counter leak on swapout from offline cgroup") --- mm/memcontrol.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.9.0 diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 2ff0289ad061..e8d787163b65 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -4082,6 +4082,7 @@ static void mem_cgroup_id_get_many(struct mem_cgroup *memcg, unsigned int n) atomic_add(n, &memcg->id.ref); } +#ifdef CONFIG_MEMCG_SWAP static struct mem_cgroup *mem_cgroup_id_get_online(struct mem_cgroup *memcg) { while (!atomic_inc_not_zero(&memcg->id.ref)) { @@ -4099,6 +4100,7 @@ static struct mem_cgroup *mem_cgroup_id_get_online(struct mem_cgroup *memcg) } return memcg; } +#endif static void mem_cgroup_id_put_many(struct mem_cgroup *memcg, unsigned int n) {