# \[PATCH\] mm/memcontrol: fix defined but not used compiler warning

- Subsystems: CONTROL GROUP - MEMORY RESOURCE CONTROLLER (MEMCG), MEMORY MANAGEMENT, THE REST
- Maintainers: Johannes Weiner, Michal Hocko, Roman Gushchin, Shakeel Butt, Andrew Morton, Linus Torvalds
- List: cgroups
- 2 messages, 2 authors
- Page: https://ratatoskr.run/cgroups/2014/12/4386708/t

## \[PATCH\] mm/memcontrol: fix defined but not used compiler warning

- From: Michele Curti \<hidden\>
- Date: 2014-12-02 11:07:58 
- Message: https://ratatoskr.run/cgroups/2014/12/4386708.md

```text
test_mem_cgroup_node_reclaimable is used only when MAX_NUMNODES > 1,
so move it into the compiler if statement

Signed-off-by: Michele Curti <redacted>
---
 mm/memcontrol.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index c6ac50e..84531a9 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -1615,6 +1615,7 @@ static void mem_cgroup_out_of_memory(struct mem_cgroup *memcg, gfp_t gfp_mask,
 	oom_kill_process(chosen, gfp_mask, order, points, totalpages, memcg,
 			 NULL, "Memory cgroup out of memory");
 }
+#if MAX_NUMNODES > 1
 
 /**
  * test_mem_cgroup_node_reclaimable
@@ -1638,7 +1639,6 @@ static bool test_mem_cgroup_node_reclaimable(struct mem_cgroup *memcg,
 	return false;
 
 }
-#if MAX_NUMNODES > 1
 
 /*
  * Always updating the nodemask is not very good - even if we have an empty
-- 
2.1.3

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
```

## Re: \[PATCH\] mm/memcontrol: fix defined but not used compiler warning

- From: Michal Hocko \<hidden\>
- Date: 2014-12-02 11:48:33 
- Message: https://ratatoskr.run/cgroups/2014/12/4386732.md

```text
On Tue 02-12-14 12:07:52, Michele Curti wrote:
> test_mem_cgroup_node_reclaimable is used only when MAX_NUMNODES > 1,
> so move it into the compiler if statement
> 
> Signed-off-by: Michele Curti <redacted>

Acked-by: Michal Hocko <redacted>

> ---
>  mm/memcontrol.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index c6ac50e..84531a9 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -1615,6 +1615,7 @@ static void mem_cgroup_out_of_memory(struct mem_cgroup *memcg, gfp_t gfp_mask,
>  	oom_kill_process(chosen, gfp_mask, order, points, totalpages, memcg,
>  			 NULL, "Memory cgroup out of memory");
>  }
> +#if MAX_NUMNODES > 1
>  
>  /**
>   * test_mem_cgroup_node_reclaimable
> @@ -1638,7 +1639,6 @@ static bool test_mem_cgroup_node_reclaimable(struct mem_cgroup *memcg,
>  	return false;
>  
>  }
> -#if MAX_NUMNODES > 1
>  
>  /*
>   * Always updating the nodemask is not very good - even if we have an empty
> -- 
> 2.1.3
> 

-- 
Michal Hocko
SUSE Labs

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
```
