Skip to content

Commit

Permalink
lockdep: annotate reclaim context (__GFP_NOFS), fix
Browse files Browse the repository at this point in the history
Impact: fix build warning

Fix:

  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 <rusty@rustcorp.com.au>
Cc: Mike Travis <travis@sgi.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Nick Piggin <npiggin@suse.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Ingo Molnar committed Feb 15, 2009
1 parent 868a23a commit 6700ec6
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions mm/vmscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

lockdep_set_current_reclaim_state(GFP_KERNEL);

node_to_cpumask_ptr(cpumask, pgdat->node_id);

if (!cpumask_empty(cpumask))
set_cpus_allowed_ptr(tsk, cpumask);
current->reclaim_state = &reclaim_state;
Expand Down

0 comments on commit 6700ec6

Please sign in to comment.