LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
To: Johannes Weiner <hannes@cmpxchg.org>, Michal Hocko <mhocko@suse.cz>
Cc: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>,
	cgroups@vger.kernel.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH] mm: memcontrol.c:  Cleaning up function that are not used anywhere
Date: Sat,  6 Dec 2014 17:45:56 +0100	[thread overview]
Message-ID: <1417884356-3086-1-git-send-email-rickard_strandqvist@spectrumdigital.se> (raw)

Remove function mem_cgroup_lru_names_not_uptodate() that is not used anywhere.
And move BUILD_BUG_ON() to the beginning of memcg_stat_show() instead.

This was partially found by using a static code analysis program called cppcheck.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
---
 mm/memcontrol.c |    7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index d6ac0e3..5e2f0f3 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -4379,17 +4379,14 @@ static int memcg_numa_stat_show(struct seq_file *m, void *v)
 }
 #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)
 {
 	struct mem_cgroup *memcg = mem_cgroup_from_css(seq_css(m));
 	struct mem_cgroup *mi;
 	unsigned int i;
 
+	BUILD_BUG_ON(ARRAY_SIZE(mem_cgroup_lru_names) != NR_LRU_LISTS);
+
 	for (i = 0; i < MEM_CGROUP_STAT_NSTATS; i++) {
 		if (i == MEM_CGROUP_STAT_SWAP && !do_swap_account)
 			continue;
-- 
1.7.10.4


             reply	other threads:[~2014-12-06 16:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-06 16:45 Rickard Strandqvist [this message]
2014-12-07 10:31 ` Michal Hocko
2014-12-08 16:02 ` Johannes Weiner
  -- strict thread matches above, loose matches on Subject: below --
2014-12-02 22:41 Rickard Strandqvist
2014-12-03  9:22 ` Michal Hocko
2014-12-03 15:22 ` Johannes Weiner
2014-12-03 15:54   ` Michal Hocko
2014-12-03 17:04     ` Rickard Strandqvist

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1417884356-3086-1-git-send-email-rickard_strandqvist@spectrumdigital.se \
    --to=rickard_strandqvist@spectrumdigital.se \
    --cc=cgroups@vger.kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.cz \
    --subject='Re: [PATCH] mm: memcontrol.c:  Cleaning up function that are not used anywhere' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).