Remove function mem_cgroup_lru_names_not_uptodate() that is not used anywhere.
This was partially found by using a static code analysis program called cppcheck.
Signed-off-by: Rickard Strandqvist <[email protected]>
---
mm/memcontrol.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index d6ac0e3..5edd1fe 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -4379,11 +4379,6 @@ 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));
--
1.7.10.4
On Tue 02-12-14 23:41:23, Rickard Strandqvist wrote:
> Remove function mem_cgroup_lru_names_not_uptodate() that is not used anywhere.
>
> This was partially found by using a static code analysis program called cppcheck.
>
> Signed-off-by: Rickard Strandqvist <[email protected]>
Acked-by: Michal Hocko <[email protected]>
> ---
> mm/memcontrol.c | 5 -----
> 1 file changed, 5 deletions(-)
>
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index d6ac0e3..5edd1fe 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -4379,11 +4379,6 @@ 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));
> --
> 1.7.10.4
>
--
Michal Hocko
SUSE Labs
On Tue, Dec 02, 2014 at 11:41:23PM +0100, Rickard Strandqvist wrote:
> Remove function mem_cgroup_lru_names_not_uptodate() that is not used anywhere.
>
> This was partially found by using a static code analysis program called cppcheck.
>
> Signed-off-by: Rickard Strandqvist <[email protected]>
> ---
> mm/memcontrol.c | 5 -----
> 1 file changed, 5 deletions(-)
>
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index d6ac0e3..5edd1fe 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -4379,11 +4379,6 @@ 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);
> -}
That assertion doesn't work in an unused function, but we still want
this check. Please move the BUILD_BUG_ON() to the beginning of
memcg_stat_show() instead.
On Wed 03-12-14 10:22:31, Johannes Weiner wrote:
> On Tue, Dec 02, 2014 at 11:41:23PM +0100, Rickard Strandqvist wrote:
> > Remove function mem_cgroup_lru_names_not_uptodate() that is not used anywhere.
> >
> > This was partially found by using a static code analysis program called cppcheck.
> >
> > Signed-off-by: Rickard Strandqvist <[email protected]>
> > ---
> > mm/memcontrol.c | 5 -----
> > 1 file changed, 5 deletions(-)
> >
> > diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> > index d6ac0e3..5edd1fe 100644
> > --- a/mm/memcontrol.c
> > +++ b/mm/memcontrol.c
> > @@ -4379,11 +4379,6 @@ 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);
> > -}
>
> That assertion doesn't work in an unused function, but we still want
> this check. Please move the BUILD_BUG_ON() to the beginning of
> memcg_stat_show() instead.
Ohh. I have completely missed the point of the check! Moving the check
to memcg_stat_show sounds like a good idea.
--
Michal Hocko
SUSE Labs
2014-12-03 16:54 GMT+01:00 Michal Hocko <[email protected]>:
> On Wed 03-12-14 10:22:31, Johannes Weiner wrote:
>> On Tue, Dec 02, 2014 at 11:41:23PM +0100, Rickard Strandqvist wrote:
>> > Remove function mem_cgroup_lru_names_not_uptodate() that is not used anywhere.
>> >
>> > This was partially found by using a static code analysis program called cppcheck.
>> >
>> > Signed-off-by: Rickard Strandqvist <[email protected]>
>> > ---
>> > mm/memcontrol.c | 5 -----
>> > 1 file changed, 5 deletions(-)
>> >
>> > diff --git a/mm/memcontrol.c b/mm/memcontrol.c
>> > index d6ac0e3..5edd1fe 100644
>> > --- a/mm/memcontrol.c
>> > +++ b/mm/memcontrol.c
>> > @@ -4379,11 +4379,6 @@ 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);
>> > -}
>>
>> That assertion doesn't work in an unused function, but we still want
>> this check. Please move the BUILD_BUG_ON() to the beginning of
>> memcg_stat_show() instead.
>
> Ohh. I have completely missed the point of the check! Moving the check
> to memcg_stat_show sounds like a good idea.
>
> --
> Michal Hocko
> SUSE Labs
Hi
Ok, sure I'll fix that!
It will take a few days before I will have access to my workstation,
however, but the new patch on the way...
Kind regards
Rickard Strandqvist