[xlnx:master 221/248] include/linux/regmap.h:844:27: warning: 'regmap' may be used uninitialized in this function

kernel test robot lkp at intel.com
Thu Dec 3 07:44:49 EST 2020


tree:   https://github.com/Xilinx/linux-xlnx master
head:   d7bf2c5ca00ea84cd262bed57b02c49216a87838
commit: b47e0193da3feb90d4f2f823422d84fbbc6545c7 [221/248] regulator: da9121: Use gpio descriptors instead of numbers
config: nds32-randconfig-p002-20201203 (attached as .config)
compiler: nds32le-linux-gcc (GCC) 9.3.0
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://github.com/Xilinx/linux-xlnx/commit/b47e0193da3feb90d4f2f823422d84fbbc6545c7
        git remote add xlnx https://github.com/Xilinx/linux-xlnx
        git fetch --no-tags xlnx master
        git checkout b47e0193da3feb90d4f2f823422d84fbbc6545c7
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=nds32 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp at intel.com>

Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings

All warnings (new ones prefixed by >>):

   drivers/regulator/da9121-regulator.c: In function 'da9121_handle_notifier':
   drivers/regulator/da9121-regulator.c:748:14: error: passing argument 1 of 'mutex_lock' from incompatible pointer type [-Werror=incompatible-pointer-types]
     748 |   mutex_lock(&rdev->mutex);
         |              ^~~~~~~~~~~~
         |              |
         |              struct ww_mutex *
   In file included from include/linux/kernfs.h:12,
                    from include/linux/sysfs.h:16,
                    from include/linux/kobject.h:20,
                    from include/linux/of.h:17,
                    from include/linux/irqdomain.h:35,
                    from include/linux/acpi.h:13,
                    from include/linux/i2c.h:13,
                    from drivers/regulator/da9121-regulator.c:20:
   include/linux/mutex.h:165:38: note: expected 'struct mutex *' but argument is of type 'struct ww_mutex *'
     165 | extern void mutex_lock(struct mutex *lock);
         |                        ~~~~~~~~~~~~~~^~~~
   drivers/regulator/da9121-regulator.c:750:16: error: passing argument 1 of 'mutex_unlock' from incompatible pointer type [-Werror=incompatible-pointer-types]
     750 |   mutex_unlock(&rdev->mutex);
         |                ^~~~~~~~~~~~
         |                |
         |                struct ww_mutex *
   In file included from include/linux/kernfs.h:12,
                    from include/linux/sysfs.h:16,
                    from include/linux/kobject.h:20,
                    from include/linux/of.h:17,
                    from include/linux/irqdomain.h:35,
                    from include/linux/acpi.h:13,
                    from include/linux/i2c.h:13,
                    from drivers/regulator/da9121-regulator.c:20:
   include/linux/mutex.h:184:40: note: expected 'struct mutex *' but argument is of type 'struct ww_mutex *'
     184 | extern void mutex_unlock(struct mutex *lock);
         |                          ~~~~~~~~~~~~~~^~~~
   In file included from drivers/regulator/da9121-regulator.c:26:
   drivers/regulator/da9121-regulator.c: In function 'da9121_i2c_probe':
>> include/linux/regmap.h:844:27: warning: 'regmap' may be used uninitialized in this function [-Wmaybe-uninitialized]
     844 |  __regmap_lockdep_wrapper(__devm_regmap_init_i2c, #config, \
         |                           ^~~~~~~~~~~~~~~~~~~~~~
   drivers/regulator/da9121-regulator.c:1250:24: note: 'regmap' was declared here
    1250 |  struct regmap_config *regmap;
         |                        ^~~~~~
   cc1: some warnings being treated as errors

vim +/regmap +844 include/linux/regmap.h

c0eb46766d395da Mark Brown      2012-01-30  801  
7c22ce6e218403f Vinod Koul      2018-01-08  802  /**
7c22ce6e218403f Vinod Koul      2018-01-08  803   * regmap_init_sdw() - Initialise register map
7c22ce6e218403f Vinod Koul      2018-01-08  804   *
7c22ce6e218403f Vinod Koul      2018-01-08  805   * @sdw: Device that will be interacted with
7c22ce6e218403f Vinod Koul      2018-01-08  806   * @config: Configuration for register map
7c22ce6e218403f Vinod Koul      2018-01-08  807   *
7c22ce6e218403f Vinod Koul      2018-01-08  808   * The return value will be an ERR_PTR() on error or a valid pointer to
7c22ce6e218403f Vinod Koul      2018-01-08  809   * a struct regmap.
7c22ce6e218403f Vinod Koul      2018-01-08  810   */
7c22ce6e218403f Vinod Koul      2018-01-08  811  #define regmap_init_sdw(sdw, config)					\
7c22ce6e218403f Vinod Koul      2018-01-08  812  	__regmap_lockdep_wrapper(__regmap_init_sdw, #config,		\
7c22ce6e218403f Vinod Koul      2018-01-08  813  				sdw, config)
7c22ce6e218403f Vinod Koul      2018-01-08  814  
7c22ce6e218403f Vinod Koul      2018-01-08  815  
1ed8111443ae8ca Nicolas Boichat 2015-08-11  816  /**
2cf8e2dfdf88363 Charles Keepax  2017-01-12  817   * devm_regmap_init() - Initialise managed register map
1ed8111443ae8ca Nicolas Boichat 2015-08-11  818   *
1ed8111443ae8ca Nicolas Boichat 2015-08-11  819   * @dev: Device that will be interacted with
1ed8111443ae8ca Nicolas Boichat 2015-08-11  820   * @bus: Bus-specific callbacks to use with device
1ed8111443ae8ca Nicolas Boichat 2015-08-11  821   * @bus_context: Data passed to bus-specific callbacks
1ed8111443ae8ca Nicolas Boichat 2015-08-11  822   * @config: Configuration for register map
1ed8111443ae8ca Nicolas Boichat 2015-08-11  823   *
1ed8111443ae8ca Nicolas Boichat 2015-08-11  824   * The return value will be an ERR_PTR() on error or a valid pointer
1ed8111443ae8ca Nicolas Boichat 2015-08-11  825   * to a struct regmap.  This function should generally not be called
1ed8111443ae8ca Nicolas Boichat 2015-08-11  826   * directly, it should be called by bus-specific init functions.  The
1ed8111443ae8ca Nicolas Boichat 2015-08-11  827   * map will be automatically freed by the device management code.
1ed8111443ae8ca Nicolas Boichat 2015-08-11  828   */
3cfe7a74d42b7e3 Nicolas Boichat 2015-07-08  829  #define devm_regmap_init(dev, bus, bus_context, config)			\
3cfe7a74d42b7e3 Nicolas Boichat 2015-07-08  830  	__regmap_lockdep_wrapper(__devm_regmap_init, #config,		\
3cfe7a74d42b7e3 Nicolas Boichat 2015-07-08  831  				dev, bus, bus_context, config)
1ed8111443ae8ca Nicolas Boichat 2015-08-11  832  
1ed8111443ae8ca Nicolas Boichat 2015-08-11  833  /**
2cf8e2dfdf88363 Charles Keepax  2017-01-12  834   * devm_regmap_init_i2c() - Initialise managed register map
1ed8111443ae8ca Nicolas Boichat 2015-08-11  835   *
1ed8111443ae8ca Nicolas Boichat 2015-08-11  836   * @i2c: Device that will be interacted with
1ed8111443ae8ca Nicolas Boichat 2015-08-11  837   * @config: Configuration for register map
1ed8111443ae8ca Nicolas Boichat 2015-08-11  838   *
1ed8111443ae8ca Nicolas Boichat 2015-08-11  839   * The return value will be an ERR_PTR() on error or a valid pointer
1ed8111443ae8ca Nicolas Boichat 2015-08-11  840   * to a struct regmap.  The regmap will be automatically freed by the
1ed8111443ae8ca Nicolas Boichat 2015-08-11  841   * device management code.
1ed8111443ae8ca Nicolas Boichat 2015-08-11  842   */
3cfe7a74d42b7e3 Nicolas Boichat 2015-07-08  843  #define devm_regmap_init_i2c(i2c, config)				\
3cfe7a74d42b7e3 Nicolas Boichat 2015-07-08 @844  	__regmap_lockdep_wrapper(__devm_regmap_init_i2c, #config,	\
3cfe7a74d42b7e3 Nicolas Boichat 2015-07-08  845  				i2c, config)
1ed8111443ae8ca Nicolas Boichat 2015-08-11  846  

:::::: The code at line 844 was first introduced by commit
:::::: 3cfe7a74d42b7e3644f8b2b26aa20146d4f90f0f regmap: Use different lockdep class for each regmap init call

:::::: TO: Nicolas Boichat <drinkcat at chromium.org>
:::::: CC: Mark Brown <broonie at kernel.org>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 26961 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20201203/305a8fb0/attachment-0001.gz>


More information about the linux-arm-kernel mailing list