All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: <oe-kbuild@lists.linux.dev>
Cc: <lkp@intel.com>, Dan Carpenter <error27@gmail.com>
Subject: Re: [PATCH RFC] hwmon: Add Support for PMIC5000 Power Management ICs
Date: Sun, 23 Aug 2026 19:45:02 +0800	[thread overview]
Message-ID: <202608231513.PfEj0vse-lkp@intel.com> (raw)

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <20260819-pmic5000-v1-1-e5e0ddcf0863@stevetech.au>
References: <20260819-pmic5000-v1-1-e5e0ddcf0863@stevetech.au>
TO: Stephen Horvath <linux@stevetech.au>

Hi Stephen,

[This is a private test report for your RFC patch.]
kernel test robot noticed the following build warnings:

[auto build test WARNING on 75f2c0b3690702c90863c2e138cb5520670845ea]

url:    https://github.com/intel-lab-lkp/linux/commits/Stephen-Horvath/hwmon-Add-Support-for-PMIC5000-Power-Management-ICs/20260819-233745
base:   75f2c0b3690702c90863c2e138cb5520670845ea
patch link:    https://lore.kernel.org/r/20260819-pmic5000-v1-1-e5e0ddcf0863%40stevetech.au
patch subject: [PATCH RFC] hwmon: Add Support for PMIC5000 Power Management ICs
:::::: branch date: 2 days ago
:::::: commit date: 2 days ago
config: riscv-randconfig-r071-20260823 (https://download.01.org/0day-ci/archive/20260823/202608231513.PfEj0vse-lkp@intel.com/config)
compiler: riscv64-linux-gcc (GCC) 12.5.0
smatch: v0.5.0-9187-g5189e3fb

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@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202608231513.PfEj0vse-lkp@intel.com/

New smatch warnings:
drivers/hwmon/pmic5000.c:370 pmic5000_read_volt_thresholds() warn: statement has no effect 'const'

Old smatch warnings:
drivers/hwmon/pmic5000.c:376 pmic5000_read_volt_thresholds() warn: statement has no effect 'const'

vim +/const +370 drivers/hwmon/pmic5000.c

a0d30d2a53a818 Stephen Horvath 2026-08-19  290  
a0d30d2a53a818 Stephen Horvath 2026-08-19  291  static int pmic5000_read_volt_thresholds(struct regmap *regmap, u32 attr,
a0d30d2a53a818 Stephen Horvath 2026-08-19  292  					 int channel, long *val)
a0d30d2a53a818 Stephen Horvath 2026-08-19  293  {
a0d30d2a53a818 Stephen Horvath 2026-08-19  294  	int err;
a0d30d2a53a818 Stephen Horvath 2026-08-19  295  	u32 set_reg, thresh_reg, range_bit;
a0d30d2a53a818 Stephen Horvath 2026-08-19  296  	u32 set_regval, thresh_regval, range_regval;
a0d30d2a53a818 Stephen Horvath 2026-08-19  297  	u32 volt_set;
a0d30d2a53a818 Stephen Horvath 2026-08-19  298  	int base_volts[2];
a0d30d2a53a818 Stephen Horvath 2026-08-19  299  
a0d30d2a53a818 Stephen Horvath 2026-08-19  300  	switch (channel) {
a0d30d2a53a818 Stephen Horvath 2026-08-19  301  	case 0:
a0d30d2a53a818 Stephen Horvath 2026-08-19  302  		set_reg = PMIC5000_REG_SWA_VOLT_SET;
a0d30d2a53a818 Stephen Horvath 2026-08-19  303  		thresh_reg = PMIC5000_REG_SWA_THRESH;
a0d30d2a53a818 Stephen Horvath 2026-08-19  304  		range_bit = PMIC5000_SWA_RANGE;
a0d30d2a53a818 Stephen Horvath 2026-08-19  305  		base_volts[0] = 800;
a0d30d2a53a818 Stephen Horvath 2026-08-19  306  		base_volts[1] = 600;
a0d30d2a53a818 Stephen Horvath 2026-08-19  307  		break;
a0d30d2a53a818 Stephen Horvath 2026-08-19  308  	case 1:
a0d30d2a53a818 Stephen Horvath 2026-08-19  309  		set_reg = PMIC5000_REG_SWB_VOLT_SET;
a0d30d2a53a818 Stephen Horvath 2026-08-19  310  		thresh_reg = PMIC5000_REG_SWB_THRESH;
a0d30d2a53a818 Stephen Horvath 2026-08-19  311  		range_bit = PMIC5000_SWB_RANGE;
a0d30d2a53a818 Stephen Horvath 2026-08-19  312  		base_volts[0] = 800;
a0d30d2a53a818 Stephen Horvath 2026-08-19  313  		base_volts[1] = 600;
a0d30d2a53a818 Stephen Horvath 2026-08-19  314  		break;
a0d30d2a53a818 Stephen Horvath 2026-08-19  315  	case 2:
a0d30d2a53a818 Stephen Horvath 2026-08-19  316  		set_reg = PMIC5000_REG_SWC_VOLT_SET;
a0d30d2a53a818 Stephen Horvath 2026-08-19  317  		thresh_reg = PMIC5000_REG_SWC_THRESH;
a0d30d2a53a818 Stephen Horvath 2026-08-19  318  		range_bit = PMIC5000_SWC_RANGE;
a0d30d2a53a818 Stephen Horvath 2026-08-19  319  		base_volts[0] = 800;
a0d30d2a53a818 Stephen Horvath 2026-08-19  320  		base_volts[1] = 600;
a0d30d2a53a818 Stephen Horvath 2026-08-19  321  		break;
a0d30d2a53a818 Stephen Horvath 2026-08-19  322  	case 3:
a0d30d2a53a818 Stephen Horvath 2026-08-19  323  		set_reg = PMIC5000_REG_SWD_VOLT_SET;
a0d30d2a53a818 Stephen Horvath 2026-08-19  324  		thresh_reg = PMIC5000_REG_SWD_THRESH;
a0d30d2a53a818 Stephen Horvath 2026-08-19  325  		range_bit = PMIC5000_SWD_RANGE;
a0d30d2a53a818 Stephen Horvath 2026-08-19  326  		base_volts[0] = 1500;
a0d30d2a53a818 Stephen Horvath 2026-08-19  327  		base_volts[1] = 2200;
a0d30d2a53a818 Stephen Horvath 2026-08-19  328  		break;
a0d30d2a53a818 Stephen Horvath 2026-08-19  329  	case 5:
a0d30d2a53a818 Stephen Horvath 2026-08-19  330  	case 6: {
a0d30d2a53a818 Stephen Horvath 2026-08-19  331  		err = regmap_read(regmap, PMIC5000_REG_THRES_AND_SEL,
a0d30d2a53a818 Stephen Horvath 2026-08-19  332  				  &thresh_regval);
a0d30d2a53a818 Stephen Horvath 2026-08-19  333  		if (err)
a0d30d2a53a818 Stephen Horvath 2026-08-19  334  			return err;
a0d30d2a53a818 Stephen Horvath 2026-08-19  335  		if (channel == 5) {
a0d30d2a53a818 Stephen Horvath 2026-08-19  336  			if (thresh_regval & PMIC5000_VIN_BULK_THRESH)
a0d30d2a53a818 Stephen Horvath 2026-08-19  337  				*val = 14500;
a0d30d2a53a818 Stephen Horvath 2026-08-19  338  			else
a0d30d2a53a818 Stephen Horvath 2026-08-19  339  				*val = 16000;
a0d30d2a53a818 Stephen Horvath 2026-08-19  340  			return 0;
a0d30d2a53a818 Stephen Horvath 2026-08-19  341  		} else {
a0d30d2a53a818 Stephen Horvath 2026-08-19  342  			if (thresh_regval & PMIC5000_VIN_MGMT_THRESH)
a0d30d2a53a818 Stephen Horvath 2026-08-19  343  				*val = 3800;
a0d30d2a53a818 Stephen Horvath 2026-08-19  344  			else
a0d30d2a53a818 Stephen Horvath 2026-08-19  345  				*val = 3700;
a0d30d2a53a818 Stephen Horvath 2026-08-19  346  			return 0;
a0d30d2a53a818 Stephen Horvath 2026-08-19  347  		}
a0d30d2a53a818 Stephen Horvath 2026-08-19  348  	}
a0d30d2a53a818 Stephen Horvath 2026-08-19  349  
a0d30d2a53a818 Stephen Horvath 2026-08-19  350  	default:
a0d30d2a53a818 Stephen Horvath 2026-08-19  351  		return -EOPNOTSUPP;
a0d30d2a53a818 Stephen Horvath 2026-08-19  352  	}
a0d30d2a53a818 Stephen Horvath 2026-08-19  353  
a0d30d2a53a818 Stephen Horvath 2026-08-19  354  	err = regmap_read(regmap, set_reg, &set_regval);
a0d30d2a53a818 Stephen Horvath 2026-08-19  355  	if (err)
a0d30d2a53a818 Stephen Horvath 2026-08-19  356  		return err;
a0d30d2a53a818 Stephen Horvath 2026-08-19  357  	err = regmap_read(regmap, thresh_reg, &thresh_regval);
a0d30d2a53a818 Stephen Horvath 2026-08-19  358  	if (err)
a0d30d2a53a818 Stephen Horvath 2026-08-19  359  		return err;
a0d30d2a53a818 Stephen Horvath 2026-08-19  360  	err = regmap_read(regmap, PMIC5000_REG_SW_VOLT_RANGE, &range_regval);
a0d30d2a53a818 Stephen Horvath 2026-08-19  361  	if (err)
a0d30d2a53a818 Stephen Horvath 2026-08-19  362  		return err;
a0d30d2a53a818 Stephen Horvath 2026-08-19  363  
a0d30d2a53a818 Stephen Horvath 2026-08-19  364  	volt_set = range_regval & range_bit ? base_volts[1] : base_volts[0];
a0d30d2a53a818 Stephen Horvath 2026-08-19  365  	volt_set += (set_regval >> 1) * 5;
a0d30d2a53a818 Stephen Horvath 2026-08-19  366  
a0d30d2a53a818 Stephen Horvath 2026-08-19  367  	switch (attr) {
a0d30d2a53a818 Stephen Horvath 2026-08-19  368  	case hwmon_in_min:
a0d30d2a53a818 Stephen Horvath 2026-08-19  369  		/* 10%, 12.5%, Reserved, Reserved */
a0d30d2a53a818 Stephen Horvath 2026-08-19 @370  		const int min_permilles[4] = { 100, 125, PERMILLE, PERMILLE };
a0d30d2a53a818 Stephen Horvath 2026-08-19  371  		*val = volt_set - (min_permilles[(thresh_regval >> 2) & 0x03] *
a0d30d2a53a818 Stephen Horvath 2026-08-19  372  				   volt_set / PERMILLE);
a0d30d2a53a818 Stephen Horvath 2026-08-19  373  		return 0;
a0d30d2a53a818 Stephen Horvath 2026-08-19  374  	case hwmon_in_max:
a0d30d2a53a818 Stephen Horvath 2026-08-19  375  		/* 7.5%, 10%, 12.5%, Reserved */
a0d30d2a53a818 Stephen Horvath 2026-08-19  376  		const int max_permilles[4] = { 75, 100, 125, PERMILLE };
a0d30d2a53a818 Stephen Horvath 2026-08-19  377  		*val = volt_set + (max_permilles[(thresh_regval >> 4) & 0x03] *
a0d30d2a53a818 Stephen Horvath 2026-08-19  378  				   volt_set / PERMILLE);
a0d30d2a53a818 Stephen Horvath 2026-08-19  379  		return 0;
a0d30d2a53a818 Stephen Horvath 2026-08-19  380  	default:
a0d30d2a53a818 Stephen Horvath 2026-08-19  381  		return -EOPNOTSUPP;
a0d30d2a53a818 Stephen Horvath 2026-08-19  382  	}
a0d30d2a53a818 Stephen Horvath 2026-08-19  383  }
a0d30d2a53a818 Stephen Horvath 2026-08-19  384  

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

             reply	other threads:[~2026-08-23 11:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-23 11:45 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-08-19 13:37 [PATCH RFC] hwmon: Add Support for PMIC5000 Power Management ICs Stephen Horvath
2026-08-19 13:51 ` sashiko-bot
2026-08-20 15:34 ` Guenter Roeck
2026-08-21  3:27   ` Stephen Horvath
2026-08-21  3:52     ` Guenter Roeck
2026-08-23 20:18 ` kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202608231513.PfEj0vse-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=error27@gmail.com \
    --cc=oe-kbuild@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.