Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753355AbbGOLPQ (ORCPT ); Wed, 15 Jul 2015 07:15:16 -0400 Received: from mail-wi0-f176.google.com ([209.85.212.176]:34014 "EHLO mail-wi0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752079AbbGOLPO (ORCPT ); Wed, 15 Jul 2015 07:15:14 -0400 From: Michal Hocko To: Andrew Morton , Johannes Weiner Cc: Vladimir Davydov , Tejun Heo , , LKML Subject: [PATCH 2/5] memcg: get rid of mem_cgroup_root_css for !CONFIG_MEMCG Date: Wed, 15 Jul 2015 13:14:42 +0200 Message-Id: <1436958885-18754-3-git-send-email-mhocko@kernel.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1436958885-18754-1-git-send-email-mhocko@kernel.org> References: <1436958885-18754-1-git-send-email-mhocko@kernel.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1267 Lines: 34 The only user is cgwb_bdi_init and that one depends on CONFIG_CGROUP_WRITEBACK which in turn depends on CONFIG_MEMCG so it doesn't make much sense to definte an empty stub for !CONFIG_MEMCG. Moreover ERR_PTR(-EINVAL) is ugly and would lead to runtime crashes if used in unguarded code paths. Better fail during compilation. Reviewed-by: Vladimir Davydov Signed-off-by: Michal Hocko --- include/linux/memcontrol.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 42f118ae04cf..292e6701f3fd 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h @@ -497,8 +497,6 @@ void mem_cgroup_split_huge_fixup(struct page *head); #else /* CONFIG_MEMCG */ struct mem_cgroup; -#define mem_cgroup_root_css ((struct cgroup_subsys_state *)ERR_PTR(-EINVAL)) - static inline void mem_cgroup_events(struct mem_cgroup *memcg, enum mem_cgroup_events_index idx, unsigned int nr) -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/