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] [thread-next>] [day] [month] [year] [list]
Message-ID: <202511121034.856ivnlW-lkp@intel.com>
Date: Wed, 12 Nov 2025 11:58:31 +0800
From: kernel test robot <lkp@...el.com>
To: Wenliang Yan <wenliang202407@....com>, linux@...ck-us.net,
	Jean Delvare <jdelvare@...e.com>
Cc: llvm@...ts.linux.dev, oe-kbuild-all@...ts.linux.dev,
	christophe.jaillet@...adoo.fr, conor+dt@...nel.org, corbet@....net,
	devicetree@...r.kernel.org, krzk+dt@...nel.org,
	linux-hwmon@...r.kernel.org, linux-kernel@...r.kernel.org,
	robh@...nel.org, wenliang202407@....com
Subject: Re: [PATCH 6/8] hwmon:(ina3221)Modify read/write functions for 'in'
 attribute

Hi Wenliang,

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.18-rc5 next-20251111]
[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/Wenliang-Yan/dt-binding-ti-ina3221-Add-SQ52210/20251111-161425
base:   https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git hwmon-next
patch link:    https://lore.kernel.org/r/20251111080546.32421-7-wenliang202407%40163.com
patch subject: [PATCH 6/8] hwmon:(ina3221)Modify read/write functions for 'in' attribute
config: i386-randconfig-013-20251112 (https://download.01.org/0day-ci/archive/20251112/202511121034.856ivnlW-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251112/202511121034.856ivnlW-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/202511121034.856ivnlW-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/hwmon/ina3221.c:563:21: warning: initializer overrides prior initialization of this subobject [-Winitializer-overrides]
     563 |         [hwmon_in_lcrit] = { BIT(9), BIT(8), BIT(7) },
         |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/hwmon/ina3221.c:561:23: note: previous initialization is here
     561 |         [hwmon_curr_lcrit] = { BIT(15), BIT(14), BIT(13) },
         |                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/hwmon/ina3221.c:589:2: warning: variable 'alert_group' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized]
     589 |         default:
         |         ^~~~~~~
   drivers/hwmon/ina3221.c:598:5: note: uninitialized use occurs here
     598 |                                 alert_group, 0);
         |                                 ^~~~~~~~~~~
   drivers/hwmon/ina3221.c:571:17: note: initialize the variable 'alert_group' to silence this warning
     571 |         u32 alert_group;
         |                        ^
         |                         = 0
   2 warnings generated.


vim +/alert_group +589 drivers/hwmon/ina3221.c

   559	
   560	static const u32 sq52210_alert_mask[][INA3221_NUM_CHANNELS] = {
   561		[hwmon_curr_lcrit] = { BIT(15), BIT(14), BIT(13) },
   562		[hwmon_in_crit] = { BIT(12), BIT(11), BIT(10) },
 > 563		[hwmon_in_lcrit] = { BIT(9), BIT(8), BIT(7) },
   564		[hwmon_power_crit] = { BIT(6), BIT(5), BIT(4) },
   565	};
   566	
   567	static int sq52210_alert_limit_write(struct ina3221_data *ina, u32 attr, int channel, long val)
   568	{
   569		struct regmap *regmap = ina->regmap;
   570		int ret, limit_reg, item;
   571		u32 alert_group;
   572	
   573		if (val < 0)
   574			return -EINVAL;
   575		item = channel % INA3221_NUM_CHANNELS;
   576		switch (item) {
   577		case 0:
   578			alert_group = SQ52210_MASK_ALERT_CHANNEL1;
   579			limit_reg = SQ52210_ALERT_LIMIT1;
   580			break;
   581		case 1:
   582			alert_group = SQ52210_MASK_ALERT_CHANNEL2;
   583			limit_reg = SQ52210_ALERT_LIMIT2;
   584			break;
   585		case 2:
   586			alert_group = SQ52210_MASK_ALERT_CHANNEL3;
   587			limit_reg = SQ52210_ALERT_LIMIT3;
   588			break;
 > 589		default:
   590			break;
   591		}
   592		/*
   593		 * Clear all alerts first to avoid accidentally triggering ALERT pin
   594		 * due to register write sequence. Then, only enable the alert
   595		 * if the value is non-zero.
   596		 */
   597		ret = regmap_update_bits(regmap, SQ52210_ALERT_CONFIG,
   598					alert_group, 0);
   599		if (ret < 0)
   600			return ret;
   601		ret = regmap_write(regmap, limit_reg,
   602				sq52210_alert_to_reg(ina, ina3221_curr_reg[attr][item], val));
   603		if (ret < 0)
   604			return ret;
   605	
   606		if (val)
   607			return regmap_update_bits(regmap, SQ52210_ALERT_CONFIG,
   608						alert_group, sq52210_alert_mask[attr][item]);
   609		return 0;
   610	}
   611	

-- 
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