Commit 6700ec65 authored by Ingo Molnar's avatar Ingo Molnar
Browse files

lockdep: annotate reclaim context (__GFP_NOFS), fix

Impact: fix build warning


  mm/vmscan.c: In function ‘kswapd’:
  mm/vmscan.c:1969: warning: ISO C90 forbids mixed declarations and code

node_to_cpumask_ptr(cpumask, pgdat->node_id), has a side-effect: it
defines the 'cpumask' local variable as well, so it has to go into
the variable definition section.

Sidenote: it might make sense to make this purpose of these macros
more apparent, by naming them the standard way, such as:

  DEFINE_node_to_cpumask_ptr(cpumask, pgdat->node_id);

(But that is outside the scope of this patch.)

Cc: Rusty Russell <>
Cc: Mike Travis <>
Cc: Andrew Morton <>
Cc: Nick Piggin <>
Signed-off-by: default avatarIngo Molnar <>
parent 868a23a8
......@@ -1963,11 +1963,10 @@ static int kswapd(void *p)
struct reclaim_state reclaim_state = {
.reclaimed_slab = 0,
node_to_cpumask_ptr(cpumask, pgdat->node_id);
node_to_cpumask_ptr(cpumask, pgdat->node_id);
if (!cpumask_empty(cpumask))
set_cpus_allowed_ptr(tsk, cpumask);
current->reclaim_state = &reclaim_state;
Supports Markdown
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