Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp343378ybm; Fri, 29 May 2020 01:21:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwE7VGsqLeK3Ty21H2Sx12orX8+0K/4d/xZCBoCjqNYvoRvi7iRZ6sUgA3WNl6HHXZUulWA X-Received: by 2002:a17:906:1751:: with SMTP id d17mr7049767eje.314.1590740498021; Fri, 29 May 2020 01:21:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590740498; cv=none; d=google.com; s=arc-20160816; b=nuQL8SjHi/RV7JeMoh5D+OOg6LhnqRHbF22gmEVvSDjDPKzZo2xaYMf/d0uJ77XKhn obh8+Es1d0r2shYLSBt2a78XGddF+VH2Eoe5fy5ovt0IAffmoS1tiM9eoLqjnDWffbRX ykn+2xXzQNxBSRM8bOcHb3Z8Q6MOblrjuIIi5qgpPRa91h7V7xwrUB2jmdncXzf88Im0 SNxtx6jA6LJvGISCkv9lM85kRz+WFI9C3jrS8rHgMgOJVtyLtirrsJ4chEXAE6eMtq22 5BCxF7pbmJY4BBSw0gJUZL/iYrKkIUaXGsOvBA+O1ZLcoEPmszquTRzseRt4KxISL8uy YStA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=G1DHa95zQ0abeyOJd2kcqi3BLBnsdfZBM/mDmW1g3Eg=; b=c9fldNyez2QX20Oyq2kSxJuby2xAGlgOj/MI4o73vZKLAHs7Sq1f8Iui6f/AzBZ8dm e2hyDOYO86sZRh55wA1JIWsp1co3/xwmhWv0bJ6XGmHSEk+csqfzlb0mNozo4UCf8qUs WAvxrhPrIBIvG4pZO0eWAMKPTutIE521dv1+OBIggBvrB6ZcykHhTfHdwDAhUX9qyyaI IhpfxhAP7WLdTWqzfzZHO4+/OHNQVurXb3G7VnOsIZk7TNPOfACwMeioOaGHaItIL1UK oUYq1RnWazOmtrjKoShYN3EF5kB0TjgK5F8BFRWchn/nZyzQ2VXXWZWFQItAjLIQ16UD qXag== 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u24si4752481edt.170.2020.05.29.01.21.14; Fri, 29 May 2020 01:21:38 -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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726555AbgE2ITO (ORCPT + 99 others); Fri, 29 May 2020 04:19:14 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:38332 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725306AbgE2ITN (ORCPT ); Fri, 29 May 2020 04:19:13 -0400 Received: by mail-wr1-f66.google.com with SMTP id e1so2445976wrt.5; Fri, 29 May 2020 01:19:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=G1DHa95zQ0abeyOJd2kcqi3BLBnsdfZBM/mDmW1g3Eg=; b=naRDOAuaBK7/U5thIpgYueMieMWtNXTQemh0pMpuRBY8UXKcGSob0nGVk4tEaxW20k CwDeBS9hyLZKojCFmJewv4QRqTDxP3j/02u4JyUQxygE3hfef8olndJFvP1BwxK2+mKx z6STk3dObzPjhV223T1MNG/PB15szF3gEuw+s/lX7GfB5qPF3/J54QztYtG34QHJrbQ2 pcmewp1+tF4E/hPihxDMv9pOhiMYaEygQEV2aGjHTLACuLFKMFt2y0+1vj230jJo+NGk dnkKM/eMRsCT2c0iFDe3NNy+cJgsXFHyafzK3xdxviMd41cFw3eWV8RjEMlUmRtYgD4h oQNQ== X-Gm-Message-State: AOAM532NwcHwyqf6myJ5JA3Ddd0GNMRGo8Frv8zQdX98PJIqw+UpccWW PgxvPkzwtTYZgCCAKxTQzyM= X-Received: by 2002:a5d:6586:: with SMTP id q6mr6115612wru.319.1590740351536; Fri, 29 May 2020 01:19:11 -0700 (PDT) Received: from localhost (ip-37-188-185-40.eurotel.cz. [37.188.185.40]) by smtp.gmail.com with ESMTPSA id a6sm8957998wrn.38.2020.05.29.01.19.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 May 2020 01:19:10 -0700 (PDT) Date: Fri, 29 May 2020 10:19:09 +0200 From: Michal Hocko To: Arnd Bergmann Cc: Johannes Weiner , Vladimir Davydov , Andrew Morton , Stephen Rothwell , Joonsoo Kim , Alex Shi , Hugh Dickins , "Kirill A. Shutemov" , 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: Re: [PATCH] mm: memcontrol: fix an unused-function warning Message-ID: <20200529081909.GG4406@dhcp22.suse.cz> References: <20200528095640.151454-1-arnd@arndb.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200528095640.151454-1-arnd@arndb.de> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu 28-05-20 11:56:26, Arnd Bergmann wrote: > 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") This is a linux-next sha1 which is not valid anymore. I would just drop the tag. > Signed-off-by: Arnd Bergmann Acked-by: Michal Hocko Thanks! > --- > 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 > -- Michal Hocko SUSE Labs