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>
This commit is contained in:
parent
8135be5a80
commit
70bc068c4f
@ -3692,11 +3692,6 @@ static int memcg_numa_stat_show(struct seq_file *m, void *v)
|
|||||||
}
|
}
|
||||||
#endif /* CONFIG_NUMA */
|
#endif /* CONFIG_NUMA */
|
||||||
|
|
||||||
static inline void mem_cgroup_lru_names_not_uptodate(void)
|
|
||||||
{
|
|
||||||
BUILD_BUG_ON(ARRAY_SIZE(mem_cgroup_lru_names) != NR_LRU_LISTS);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int memcg_stat_show(struct seq_file *m, void *v)
|
static int memcg_stat_show(struct seq_file *m, void *v)
|
||||||
{
|
{
|
||||||
struct mem_cgroup *memcg = mem_cgroup_from_css(seq_css(m));
|
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)
|
|||||||
struct mem_cgroup *mi;
|
struct mem_cgroup *mi;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
|
BUILD_BUG_ON(ARRAY_SIZE(mem_cgroup_lru_names) != NR_LRU_LISTS);
|
||||||
|
|
||||||
for (i = 0; i < MEM_CGROUP_STAT_NSTATS; i++) {
|
for (i = 0; i < MEM_CGROUP_STAT_NSTATS; i++) {
|
||||||
if (i == MEM_CGROUP_STAT_SWAP && !do_swap_account)
|
if (i == MEM_CGROUP_STAT_SWAP && !do_swap_account)
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
Reference in New Issue
Block a user