summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGlauber Costa <glommer@parallels.com>2013-02-05 02:28:49 +0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-02-05 13:38:48 +0400
commit91c777d86752b00bb3a1d8efa3d8f7e1264f38a9 (patch)
treebb9f3340c8109da5c29e57608f205e97a5f0e03d /include
parent631b0cfdbd801ceae8762e8d287f15da26792ebe (diff)
downloadlinux-91c777d86752b00bb3a1d8efa3d8f7e1264f38a9.tar.xz
memcg: fix typo in kmemcg cache walk macro
The macro for_each_memcg_cache_index contains a silly yet potentially deadly mistake. Although the macro parameter is _idx, the loop tests are done over i, not _idx. This hasn't generated any problems so far, because all users use i as a loop index. However, while playing with an extension of the code I ended using another loop index and the compiler was quick to complain. Unfortunately, this is not the kind of thing that testing reveals =( Signed-off-by: Glauber Costa <glommer@parallels.com> Cc: Kamezawa Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Acked-by: Michal Hocko <mhocko@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/memcontrol.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index 0108a56f814e..28bd5fa2ff2e 100644
--- a/include/linux/memcontrol.h
+++ b/include/linux/memcontrol.h
@@ -429,7 +429,7 @@ extern int memcg_limited_groups_array_size;
* the slab_mutex must be held when looping through those caches
*/
#define for_each_memcg_cache_index(_idx) \
- for ((_idx) = 0; i < memcg_limited_groups_array_size; (_idx)++)
+ for ((_idx) = 0; (_idx) < memcg_limited_groups_array_size; (_idx)++)
static inline bool memcg_kmem_enabled(void)
{