[groeck-staging:testing 1/42] drivers/hwmon/hwmon.c:432:41: warning: pointer type mismatch ('long long *' and 'long *')

[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-kexec (https://download.01.org/0day-ci/archive/20241121/202411211850.BxMkSXmZ-lkp@xxxxxxxxx/config)
compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241121/202411211850.BxMkSXmZ-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/202411211850.BxMkSXmZ-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

   In file included from drivers/hwmon/hwmon.c:17:
   In file included from include/linux/i2c.h:19:
   In file included from include/linux/regulator/consumer.h:35:
   In file included from include/linux/suspend.h:5:
   In file included from include/linux/swap.h:9:
   In file included from include/linux/memcontrol.h:21:
   In file included from include/linux/mm.h:2213:
   include/linux/vmstat.h:504:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     504 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     505 |                            item];
         |                            ~~~~
   include/linux/vmstat.h:511:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     511 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     512 |                            NR_VM_NUMA_EVENT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~~
   include/linux/vmstat.h:518:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
     518 |         return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
         |                               ~~~~~~~~~~~ ^ ~~~
   include/linux/vmstat.h:524:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     524 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     525 |                            NR_VM_NUMA_EVENT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~~
>> drivers/hwmon/hwmon.c:432:41: warning: pointer type mismatch ('long long *' and 'long *') [-Wpointer-type-mismatch]
     432 |                                hattr->type == hwmon_energy64 ? (long long *)&val64 : &val);
         |                                                              ^ ~~~~~~~~~~~~~~~~~~~   ~~~~
   5 warnings generated.


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