Re: [groeck-staging:hwmon-next 41/41] drivers/hwmon/mc34vr500.c:228:36: warning: conversion from 'long unsigned int' to 'unsigned int' changes value from '18446744073709551569' to '4294967249'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 1/24/23 10:25, kernel test robot wrote:
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git hwmon-next
head:   513d7b190ab3715103357afd8e2ddf4b5e986ff3
commit: 513d7b190ab3715103357afd8e2ddf4b5e986ff3 [41/41] hwmon: add initial NXP MC34VR500 PMIC monitoring support
config: s390-allyesconfig (https://download.01.org/0day-ci/archive/20230125/202301250221.kOJxNanJ-lkp@xxxxxxxxx/config)
compiler: s390-linux-gcc (GCC) 12.1.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://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git/commit/?id=513d7b190ab3715103357afd8e2ddf4b5e986ff3
         git remote add groeck-staging https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git
         git fetch --no-tags groeck-staging hwmon-next
         git checkout 513d7b190ab3715103357afd8e2ddf4b5e986ff3
         # save the config file
         mkdir build_dir && cp config build_dir/.config
         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=s390 olddefconfig
         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=s390 SHELL=/bin/bash

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

All warnings (new ones prefixed by >>):

    drivers/hwmon/mc34vr500.c: In function 'mc34vr500_probe':
drivers/hwmon/mc34vr500.c:228:36: warning: conversion from 'long unsigned int' to 'unsigned int' changes value from '18446744073709551569' to '4294967249' [-Woverflow]
      228 |                                    ~(LOWVINS_BIT | THERM110S_BIT |
          |                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      229 |                                    THERM120S_BIT | THERM130S_BIT));
          |                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Mario - no need to resend. I silenced it.

Guenter

vim +228 drivers/hwmon/mc34vr500.c

    163	
    164	static int mc34vr500_probe(struct i2c_client *client)
    165	{
    166		struct device *dev = &client->dev;
    167		struct mc34vr500_data *data;
    168		struct device *hwmon_dev;
    169		int ret;
    170		unsigned int reg, revid, fabid;
    171		struct regmap *regmap;
    172	
    173		regmap = devm_regmap_init_i2c(client, &mc34vr500_regmap_config);
    174		if (IS_ERR(regmap))
    175			return PTR_ERR(regmap);
    176	
    177		data = devm_kzalloc(dev, sizeof(struct mc34vr500_data), GFP_KERNEL);
    178		if (!data)
    179			return -ENOMEM;
    180	
    181		data->regmap = regmap;
    182	
    183		ret = regmap_read(regmap, MC34VR500_DEVICEID, &reg);
    184		if (ret < 0)
    185			return ret;
    186	
    187		if (reg != MC34VR500_DEVICEID_VALUE)
    188			return -ENODEV;
    189	
    190		ret = regmap_read(regmap, MC34VR500_SILICONREVID, &revid);
    191		if (ret < 0)
    192			return ret;
    193	
    194		ret = regmap_read(regmap, MC34VR500_FABID, &fabid);
    195		if (ret < 0)
    196			return ret;
    197	
    198		dev_dbg(dev, "mc34vr500: revid 0x%x fabid 0x%x\n", revid, fabid);
    199	
    200		hwmon_dev = devm_hwmon_device_register_with_info(dev, client->name,
    201								 data,
    202								 &mc34vr500_chip_info,
    203								 NULL);
    204		if (IS_ERR(hwmon_dev))
    205			return PTR_ERR(hwmon_dev);
    206	
    207		data->hwmon_dev = hwmon_dev;
    208	
    209		if (client->irq) {
    210			ret = devm_request_threaded_irq(dev, client->irq, NULL,
    211							mc34vr500_process_interrupt,
    212							IRQF_TRIGGER_RISING |
    213							IRQF_ONESHOT |
    214							IRQF_SHARED,
    215							dev_name(dev), data);
    216			if (ret)
    217				return ret;
    218	
    219			/* write 1 to clear interrupts */
    220			ret = regmap_write(regmap, MC34VR500_INTSTAT0, LOWVINS_BIT |
    221					   THERM110S_BIT | THERM120S_BIT |
    222					   THERM130S_BIT);
    223			if (ret)
    224				return ret;
    225	
    226			/* unmask interrupts */
    227			ret = regmap_write(regmap, MC34VR500_INTMASK0,
  > 228					   ~(LOWVINS_BIT | THERM110S_BIT |
    229					   THERM120S_BIT | THERM130S_BIT));
    230			if (ret)
    231				return ret;
    232		}
    233	
    234		return 0;
    235	}
    236	





[Index of Archives]     [LM Sensors]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux