include/linux/iio/iio.h:781 class___priv__iio_dev_mode_lock_try_direct_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: Radu Sabau <[email protected]>
CC: Jonathan Cameron <[email protected]>
CC: David Lechner <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   dd3210c47e8d3ac6b4e9141fc68acc03b38c0ba3
commit: 40850443aa1239f71fc65b870a0f0ecd54e42c9d iio: adc: ad4691: add initial driver for AD4691 family
date:   6 weeks ago
:::::: branch date: 10 hours ago
:::::: commit date: 6 weeks ago
config: x86_64-randconfig-161-20260708 (https://download.01.org/0day-ci/archive/20260711/[email protected]/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
smatch: v0.5.0-9185-gbcc58b9c

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: 40850443aa12 ("iio: adc: ad4691: add initial driver for AD4691 family")
| Reported-by: kernel test robot <[email protected]>
| Reported-by: Dan Carpenter <[email protected]>
| Closes: https://lore.kernel.org/r/[email protected]/

smatch warnings:
include/linux/iio/iio.h:781 class___priv__iio_dev_mode_lock_try_direct_constructor() warn: passing zero to 'ERR_PTR'

vim +/ERR_PTR +781 include/linux/iio/iio.h

847ec80bbaa76a drivers/staging/iio/iio.h Jonathan Cameron 2009-08-18  772  
7a38b75da1dc38 include/linux/iio/iio.h   Kurt Borja       2026-01-20  773  /*
7a38b75da1dc38 include/linux/iio/iio.h   Kurt Borja       2026-01-20  774   * These classes are not meant to be used directly by drivers (hence the
7a38b75da1dc38 include/linux/iio/iio.h   Kurt Borja       2026-01-20  775   * __priv__ prefix). Instead, documented wrapper macros are provided below to
7a38b75da1dc38 include/linux/iio/iio.h   Kurt Borja       2026-01-20  776   * enforce the use of ACQUIRE() or guard() semantics and avoid the problematic
7a38b75da1dc38 include/linux/iio/iio.h   Kurt Borja       2026-01-20  777   * scoped guard variants.
7a38b75da1dc38 include/linux/iio/iio.h   Kurt Borja       2026-01-20  778   */
7a38b75da1dc38 include/linux/iio/iio.h   Kurt Borja       2026-01-20  779  DEFINE_GUARD(__priv__iio_dev_mode_lock, struct iio_dev *,
7a38b75da1dc38 include/linux/iio/iio.h   Kurt Borja       2026-01-20  780  	     __iio_dev_mode_lock(_T), __iio_dev_mode_unlock(_T));
7a38b75da1dc38 include/linux/iio/iio.h   Kurt Borja       2026-01-20 @781  DEFINE_GUARD_COND(__priv__iio_dev_mode_lock, _try_direct,
7a38b75da1dc38 include/linux/iio/iio.h   Kurt Borja       2026-01-20  782  		  iio_device_claim_direct(_T));
7a38b75da1dc38 include/linux/iio/iio.h   Kurt Borja       2026-01-20  783  

:::::: The code at line 781 was first introduced by commit
:::::: 7a38b75da1dc38a8cd9563c41b87367b2475b975 iio: core: Add cleanup.h support for iio_device_claim_*()

:::::: TO: Kurt Borja <[email protected]>
:::::: CC: Jonathan Cameron <[email protected]>

--
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.