Commit 91c777d8 authored by Glauber Costa's avatar Glauber Costa Committed by Linus Torvalds
Browse files

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: default avatarGlauber Costa <>
Cc: Kamezawa Hiroyuki <>
Cc: Johannes Weiner <>
Acked-by: default avatarMichal Hocko <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 631b0cfd
...@@ -429,7 +429,7 @@ extern int memcg_limited_groups_array_size; ...@@ -429,7 +429,7 @@ extern int memcg_limited_groups_array_size;
* the slab_mutex must be held when looping through those caches * the slab_mutex must be held when looping through those caches
*/ */
#define for_each_memcg_cache_index(_idx) \ #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) static inline bool memcg_kmem_enabled(void)
{ {
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment