Skip to content

Commit

Permalink
kernel/fork.c: mark 'stack_vm_area' with __maybe_unused
Browse files Browse the repository at this point in the history
Fixes gcc '-Wunused-but-set-variable' warning when CONFIG_VMAP_STACK is
not set:

kernel/fork.c: In function 'dup_task_struct':
kernel/fork.c:843:20: warning:
 variable 'stack_vm_area' set but not used [-Wunused-but-set-variable]

Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: YueHaibing <[email protected]>
Reviewed-by: Andrew Morton <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
YueHaibing authored and torvalds committed Dec 28, 2018
1 parent 7056d3a commit 0f4991e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/fork.c
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,7 @@ static struct task_struct *dup_task_struct(struct task_struct *orig, int node)
{
struct task_struct *tsk;
unsigned long *stack;
struct vm_struct *stack_vm_area;
struct vm_struct *stack_vm_area __maybe_unused;
int err;

if (node == NUMA_NO_NODE)
Expand Down

0 comments on commit 0f4991e

Please sign in to comment.