kernel/fork.c: mark 'stack_vm_area' with __maybe_unused
authorYueHaibing <[email protected]>
Fri, 28 Dec 2018 08:40:00 +0000 (00:40 -0800)
committerLinus Torvalds <[email protected]>
Fri, 28 Dec 2018 20:11:52 +0000 (12:11 -0800)
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]>
kernel/fork.c

index c979605fe806e503e8412d74c921d783601d7691..d439c48ecf181c5914cbf467a1754ac355c830f9 100644 (file)
@@ -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)