Re: [PATCH] lib: typecheck: initialize const variable to avoid Clang warning

From: kernel test robot

Date: Wed Mar 25 2026 - 09:01:01 EST


Hi hamjin,

kernel test robot noticed the following build errors:

[auto build test ERROR on linus/master]
[also build test ERROR on v7.0-rc5 next-20260324]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url: https://github.com/intel-lab-lkp/linux/commits/hamjin/lib-typecheck-initialize-const-variable-to-avoid-Clang-warning/20260315-165617
base: linus/master
patch link: https://lore.kernel.org/r/tencent_274FD06231C70768C2C28FD13673A24C2B08%40qq.com
patch subject: [PATCH] lib: typecheck: initialize const variable to avoid Clang warning
config: s390-allyesconfig (https://download.01.org/0day-ci/archive/20260325/202603252052.cM1GQIHa-lkp@xxxxxxxxx/config)
compiler: s390-linux-gcc (GCC) 15.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260325/202603252052.cM1GQIHa-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202603252052.cM1GQIHa-lkp@xxxxxxxxx/

All errors (new ones prefixed by >>):

In file included from arch/s390/include/asm/lowcore.h:14,
from arch/s390/include/asm/current.h:13,
from include/linux/sched.h:12,
from arch/s390/kernel/asm-offsets.c:10:
arch/s390/include/asm/ptrace.h: In function 'user_mode':
>> arch/s390/include/asm/ptrace.h:224:9: error: conversion to non-scalar type requested
224 | return psw_bits(regs->psw).pstate;
| ^~~~~~
make[3]: *** [scripts/Makefile.build:184: arch/s390/kernel/asm-offsets.s] Error 1
make[3]: Target 'prepare' not remade because of errors.
make[2]: *** [Makefile:1337: prepare0] Error 2
make[2]: Target 'prepare' not remade because of errors.
make[1]: *** [Makefile:248: __sub-make] Error 2
make[1]: Target 'prepare' not remade because of errors.
make: *** [Makefile:248: __sub-make] Error 2
make: Target 'prepare' not remade because of errors.


vim +224 arch/s390/include/asm/ptrace.h

952974ac61f686 Heiko Carstens 2010-02-12 221
afa8fa52a42c31 Jens Remus 2025-12-11 222 static __always_inline bool user_mode(const struct pt_regs *regs)
afa8fa52a42c31 Jens Remus 2025-12-11 223 {
afa8fa52a42c31 Jens Remus 2025-12-11 @224 return psw_bits(regs->psw).pstate;
afa8fa52a42c31 Jens Remus 2025-12-11 225 }
afa8fa52a42c31 Jens Remus 2025-12-11 226

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki