lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <202408191001.pTmfYpUn-lkp@intel.com>
Date: Mon, 19 Aug 2024 11:22:41 +0800
From: kernel test robot <lkp@...el.com>
To: Cosmo Chou <chou.cosmo@...il.com>, linux@...ck-us.net,
	jdelvare@...e.com
Cc: llvm@...ts.linux.dev, oe-kbuild-all@...ts.linux.dev,
	linux-hwmon@...r.kernel.org, linux-kernel@...r.kernel.org,
	cosmo.chou@...ntatw.com
Subject: Re: [PATCH] hwmon: (pt5161l) Fix invalid temperature reading

Hi Cosmo,

kernel test robot noticed the following build warnings:

[auto build test WARNING on groeck-staging/hwmon-next]
[also build test WARNING on linus/master v6.11-rc4 next-20240816]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Cosmo-Chou/hwmon-pt5161l-Fix-invalid-temperature-reading/20240819-034826
base:   https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git hwmon-next
patch link:    https://lore.kernel.org/r/20240818194401.172248-1-chou.cosmo%40gmail.com
patch subject: [PATCH] hwmon: (pt5161l) Fix invalid temperature reading
config: i386-buildonly-randconfig-001-20240819 (https://download.01.org/0day-ci/archive/20240819/202408191001.pTmfYpUn-lkp@intel.com/config)
compiler: clang version 18.1.5 (https://github.com/llvm/llvm-project 617a15a9eac96088ae5e9134248d8236e34b91b1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240819/202408191001.pTmfYpUn-lkp@intel.com/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@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202408191001.pTmfYpUn-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/hwmon/pt5161l.c:452:43: warning: format specifies type 'unsigned long' but the argument has type 'u32' (aka 'unsigned int') [-Wformat]
     452 |                         dev_dbg(dev, "Invalid adc_code %lx\n", adc_code);
         |                                                        ~~~     ^~~~~~~~
         |                                                        %x
   include/linux/dev_printk.h:168:46: note: expanded from macro 'dev_dbg'
     168 |         dev_printk(KERN_DEBUG, dev, dev_fmt(fmt), ##__VA_ARGS__)
         |                                             ~~~     ^~~~~~~~~~~
   include/linux/dev_printk.h:129:34: note: expanded from macro 'dev_printk'
     129 |                 _dev_printk(level, dev, fmt, ##__VA_ARGS__);            \
         |                                         ~~~    ^~~~~~~~~~~
   1 warning generated.


vim +452 drivers/hwmon/pt5161l.c

1b2ca93cd0592b Cosmo Chou 2024-02-06  423  
1b2ca93cd0592b Cosmo Chou 2024-02-06  424  static int pt5161l_read(struct device *dev, enum hwmon_sensor_types type,
1b2ca93cd0592b Cosmo Chou 2024-02-06  425  			u32 attr, int channel, long *val)
1b2ca93cd0592b Cosmo Chou 2024-02-06  426  {
1b2ca93cd0592b Cosmo Chou 2024-02-06  427  	struct pt5161l_data *data = dev_get_drvdata(dev);
1b2ca93cd0592b Cosmo Chou 2024-02-06  428  	int ret;
1b2ca93cd0592b Cosmo Chou 2024-02-06  429  	u8 buf[8];
4aa2c2144fb2eb Cosmo Chou 2024-08-19  430  	u32 adc_code;
1b2ca93cd0592b Cosmo Chou 2024-02-06  431  
1b2ca93cd0592b Cosmo Chou 2024-02-06  432  	switch (attr) {
1b2ca93cd0592b Cosmo Chou 2024-02-06  433  	case hwmon_temp_input:
1b2ca93cd0592b Cosmo Chou 2024-02-06  434  		if (!data->init_done) {
1b2ca93cd0592b Cosmo Chou 2024-02-06  435  			ret = pt5161l_init_dev(data);
1b2ca93cd0592b Cosmo Chou 2024-02-06  436  			if (ret)
1b2ca93cd0592b Cosmo Chou 2024-02-06  437  				return ret;
1b2ca93cd0592b Cosmo Chou 2024-02-06  438  		}
1b2ca93cd0592b Cosmo Chou 2024-02-06  439  
1b2ca93cd0592b Cosmo Chou 2024-02-06  440  		mutex_lock(&data->lock);
1b2ca93cd0592b Cosmo Chou 2024-02-06  441  		ret = pt5161l_read_wide_reg(data,
1b2ca93cd0592b Cosmo Chou 2024-02-06  442  					    ARIES_CURRENT_AVG_TEMP_ADC_CSR, 4,
1b2ca93cd0592b Cosmo Chou 2024-02-06  443  					    buf);
1b2ca93cd0592b Cosmo Chou 2024-02-06  444  		mutex_unlock(&data->lock);
1b2ca93cd0592b Cosmo Chou 2024-02-06  445  		if (ret) {
1b2ca93cd0592b Cosmo Chou 2024-02-06  446  			dev_dbg(dev, "Read adc_code failed %d\n", ret);
1b2ca93cd0592b Cosmo Chou 2024-02-06  447  			return ret;
1b2ca93cd0592b Cosmo Chou 2024-02-06  448  		}
1b2ca93cd0592b Cosmo Chou 2024-02-06  449  
1b2ca93cd0592b Cosmo Chou 2024-02-06  450  		adc_code = buf[3] << 24 | buf[2] << 16 | buf[1] << 8 | buf[0];
1b2ca93cd0592b Cosmo Chou 2024-02-06  451  		if (adc_code == 0 || adc_code >= 0x3ff) {
1b2ca93cd0592b Cosmo Chou 2024-02-06 @452  			dev_dbg(dev, "Invalid adc_code %lx\n", adc_code);
1b2ca93cd0592b Cosmo Chou 2024-02-06  453  			return -EIO;
1b2ca93cd0592b Cosmo Chou 2024-02-06  454  		}
1b2ca93cd0592b Cosmo Chou 2024-02-06  455  
1b2ca93cd0592b Cosmo Chou 2024-02-06  456  		*val = 110000 +
1b2ca93cd0592b Cosmo Chou 2024-02-06  457  		       ((adc_code - (ARIES_TEMP_CAL_CODE_DEFAULT + 250)) *
1b2ca93cd0592b Cosmo Chou 2024-02-06  458  			-320);
1b2ca93cd0592b Cosmo Chou 2024-02-06  459  		break;
1b2ca93cd0592b Cosmo Chou 2024-02-06  460  	default:
1b2ca93cd0592b Cosmo Chou 2024-02-06  461  		return -EOPNOTSUPP;
1b2ca93cd0592b Cosmo Chou 2024-02-06  462  	}
1b2ca93cd0592b Cosmo Chou 2024-02-06  463  
1b2ca93cd0592b Cosmo Chou 2024-02-06  464  	return 0;
1b2ca93cd0592b Cosmo Chou 2024-02-06  465  }
1b2ca93cd0592b Cosmo Chou 2024-02-06  466  

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ