[groeck-staging:testing 1/42] drivers/hwmon/hwmon.c:432:84: warning: pointer type mismatch in conditional expression

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

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git testing
head:   b731b2c24d88f6782fdf6e1c19d735cd5aadeb3b
commit: 2c67fcdff546bc261761a3d66aa165a627b71458 [1/42] hwmon: Introduce 64-bit energy attribute support
config: x86_64-rhel-9.4 (https://download.01.org/0day-ci/archive/20241121/202411211946.6XukCd3K-lkp@xxxxxxxxx/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241121/202411211946.6XukCd3K-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/202411211946.6XukCd3K-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

   drivers/hwmon/hwmon.c: In function 'hwmon_attr_show':
>> drivers/hwmon/hwmon.c:432:84: warning: pointer type mismatch in conditional expression
     432 |                                hattr->type == hwmon_energy64 ? (long long *)&val64 : &val);
         |                                                                                    ^


vim +432 drivers/hwmon/hwmon.c

   422	
   423	static ssize_t hwmon_attr_show(struct device *dev,
   424				       struct device_attribute *devattr, char *buf)
   425	{
   426		struct hwmon_device_attribute *hattr = to_hwmon_attr(devattr);
   427		s64 val64;
   428		long val;
   429		int ret;
   430	
   431		ret = hattr->ops->read(dev, hattr->type, hattr->attr, hattr->index,
 > 432				       hattr->type == hwmon_energy64 ? (long long *)&val64 : &val);
   433		if (ret < 0)
   434			return ret;
   435	
   436		if (hattr->type != hwmon_energy64)
   437			val64 = val;
   438	
   439		trace_hwmon_attr_show(hattr->index + hwmon_attr_base(hattr->type),
   440				      hattr->name, val64);
   441	
   442		return sprintf(buf, "%lld\n", val64);
   443	}
   444	

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




[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