[peterz-queue:x86/core 1/2] arch/x86/kernel/dumpstack.c:37:6: warning: variable 'type' set but not used

From: kernel test robot
Date: Thu Sep 16 2021 - 12:50:03 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git x86/core
head: 299b8f1b37da2b189cbc17a22621df9af53ed7b3
commit: ade10c0487ed86092bc4a2ee117664e8b71fedfc [1/2] x86/dumpstack/64: Add guard pages to stack_info
config: x86_64-randconfig-c007-20210916 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project c8b3d7d6d6de37af68b2f379d0e37304f78e115f)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git/commit/?id=ade10c0487ed86092bc4a2ee117664e8b71fedfc
git remote add peterz-queue https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git
git fetch --no-tags peterz-queue x86/core
git checkout ade10c0487ed86092bc4a2ee117664e8b71fedfc
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=x86_64

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

>> arch/x86/kernel/dumpstack.c:37:6: warning: variable 'type' set but not used [-Wunused-but-set-variable]
int type = STACK_TYPE_TASK;
^
1 warning generated.


vim +/type +37 arch/x86/kernel/dumpstack.c

31
32 bool noinstr in_task_stack(unsigned long *stack, struct task_struct *task,
33 struct stack_info *info)
34 {
35 void *begin = task_stack_page(task);
36 void *end = begin + THREAD_SIZE;
> 37 int type = STACK_TYPE_TASK;
38
39 if ((void *)stack < begin || (void *)stack >= end) {
40 if (in_stack_guard(stack, begin, end)) {
41 type |= STACK_TYPE_GUARD;
42 goto fill_info;
43 }
44 return false;
45 }
46
47 fill_info:
48 info->type = STACK_TYPE_TASK;
49 info->begin = begin;
50 info->end = end;
51 info->next_sp = NULL;
52
53 return true;
54 }
55

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip