include/linux/rwsem.h:273 class_rwsem_write_try_constructor() warn: passing zero to 'ERR_PTR'

kernel test robot <[email protected]>
Newsgroups dev.linux.lists.oe-kbuild
Message-ID <[email protected]>
BCC: [email protected]
CC: [email protected]
CC: [email protected]
TO: Marco Elver <[email protected]>
CC: Peter Zijlstra <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   bcc44b6785f216eb939226ade6e3910baa30516b
commit: e4fd3be884cf33a42c5bcde087b0722a5b8f25ca locking/rwsem: Support Clang's context analysis
date:   7 months ago
:::::: branch date: 35 minutes ago
:::::: commit date: 7 months ago
config: openrisc-randconfig-r073-20260807 (https://download.01.org/0day-ci/archive/20260808/[email protected]/config)
compiler: or1k-linux-gcc (GCC) 10.5.0
smatch: v0.5.0-9187-g5189e3fb

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
| Fixes: e4fd3be884cf ("locking/rwsem: Support Clang's context analysis")
| Reported-by: kernel test robot <[email protected]>
| Reported-by: Dan Carpenter <[email protected]>
| Closes: https://lore.kernel.org/r/[email protected]/

New smatch warnings:
include/linux/rwsem.h:273 class_rwsem_write_try_constructor() warn: passing zero to 'ERR_PTR'

Old smatch warnings:
lib/test_context-analysis.c:96 test_raw_spinlock_trylock_extra() warn: mixing irq and irqsave
include/linux/spinlock.h:556 class_raw_spinlock_try_constructor() warn: passing zero to 'ERR_PTR'
lib/test_context-analysis.c:120 test_spinlock_trylock_extra() warn: mixing irq and irqsave
include/linux/spinlock.h:604 class_spinlock_try_constructor() warn: passing zero to 'ERR_PTR'
include/linux/mutex.h:255 class_mutex_try_constructor() warn: passing zero to 'ERR_PTR'
include/linux/rwsem.h:262 class_rwsem_read_try_constructor() warn: passing zero to 'ERR_PTR'

vim +/ERR_PTR +273 include/linux/rwsem.h

e4fd3be884cf33 Marco Elver 2025-12-19  271  
e4fd3be884cf33 Marco Elver 2025-12-19  272  DEFINE_LOCK_GUARD_1(rwsem_write, struct rw_semaphore, down_write(_T->lock), up_write(_T->lock))
e4fd3be884cf33 Marco Elver 2025-12-19 @273  DEFINE_LOCK_GUARD_1_COND(rwsem_write, _try, down_write_trylock(_T->lock))
e4fd3be884cf33 Marco Elver 2025-12-19  274  DEFINE_LOCK_GUARD_1_COND(rwsem_write, _kill, down_write_killable(_T->lock), _RET == 0)
e4fd3be884cf33 Marco Elver 2025-12-19  275  

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.