aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRickard Strandqvist <rickard_strandqvist@spectrumdigital.se>2014-12-12 19:56:41 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-12-13 15:42:49 -0500
commit70bc068c4f94e42b79de8f80d0aa560bc6daedec (patch)
tree69540286d77a02fee765b781fcda4a4693756222
parent8135be5a8012f4c7e95218563855e16c09a8271b (diff)
mm/memcontrol.c: remove unused mem_cgroup_lru_names_not_uptodate()
Remove unused mem_cgroup_lru_names_not_uptodate() and move BUILD_BUG_ON() to the beginning of memcg_stat_show(). This was partially found by using a static code analysis program called cppcheck. Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Michal Hocko <mhocko@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--mm/memcontrol.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 05e1584750ac..ef91e856c7e4 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -3692,11 +3692,6 @@ static int memcg_numa_stat_show(struct seq_file *m, void *v)
3692} 3692}
3693#endif /* CONFIG_NUMA */ 3693#endif /* CONFIG_NUMA */
3694 3694
3695static inline void mem_cgroup_lru_names_not_uptodate(void)
3696{
3697 BUILD_BUG_ON(ARRAY_SIZE(mem_cgroup_lru_names) != NR_LRU_LISTS);
3698}
3699
3700static int memcg_stat_show(struct seq_file *m, void *v) 3695static int memcg_stat_show(struct seq_file *m, void *v)
3701{ 3696{
3702 struct mem_cgroup *memcg = mem_cgroup_from_css(seq_css(m)); 3697 struct mem_cgroup *memcg = mem_cgroup_from_css(seq_css(m));
@@ -3704,6 +3699,8 @@ static int memcg_stat_show(struct seq_file *m, void *v)
3704 struct mem_cgroup *mi; 3699 struct mem_cgroup *mi;
3705 unsigned int i; 3700 unsigned int i;
3706 3701
3702 BUILD_BUG_ON(ARRAY_SIZE(mem_cgroup_lru_names) != NR_LRU_LISTS);
3703
3707 for (i = 0; i < MEM_CGROUP_STAT_NSTATS; i++) { 3704 for (i = 0; i < MEM_CGROUP_STAT_NSTATS; i++) {
3708 if (i == MEM_CGROUP_STAT_SWAP && !do_swap_account) 3705 if (i == MEM_CGROUP_STAT_SWAP && !do_swap_account)
3709 continue; 3706 continue;