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
Subject: Re: [PATCH next resend 2/5] minmax: Allow min()/max()/clamp() if the arguments have the same signedness.
Date: Sat, 29 Jul 2023 07:47:36 +0800	[thread overview]
Message-ID: <202307290758.YrrAnTBI-lkp@intel.com> (raw)

:::::: 
:::::: Manual check reason: "low confidence static check first_new_problem: drivers/hwmon/bt1-pvt.c:354:24: sparse: sparse: bad integer constant expression"
:::::: 

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <a09512c8526b46759669d0b879144563@AcuMS.aculab.com>
References: <a09512c8526b46759669d0b879144563@AcuMS.aculab.com>
TO: David Laight <David.Laight@ACULAB.COM>
TO: "'linux-kernel@vger.kernel.org'" <linux-kernel@vger.kernel.org>
TO: "'Andy Shevchenko'" <andriy.shevchenko@linux.intel.com>
TO: "'Andrew Morton'" <akpm@linux-foundation.org>
CC: Linux Memory Management List <linux-mm@kvack.org>
TO: "'Matthew Wilcox (Oracle)'" <willy@infradead.org>
TO: "'Christoph Hellwig'" <hch@infradead.org>
TO: "'Jason A. Donenfeld'" <Jason@zx2c4.com>

Hi David,

kernel test robot noticed the following build warnings:

[auto build test WARNING on akpm-mm/mm-everything]
[also build test WARNING on linus/master crng-random/master v6.5-rc3 next-20230728]
[cannot apply to next-20230725]
[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/David-Laight/minmax-Allow-min-max-clamp-if-the-arguments-have-the-same-signedness/20230725-204940
base:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
patch link:    https://lore.kernel.org/r/a09512c8526b46759669d0b879144563%40AcuMS.aculab.com
patch subject: [PATCH next resend 2/5] minmax: Allow min()/max()/clamp() if the arguments have the same signedness.
:::::: branch date: 3 days ago
:::::: commit date: 3 days ago
config: sparc64-randconfig-r082-20230728 (https://download.01.org/0day-ci/archive/20230729/202307290758.YrrAnTBI-lkp@intel.com/config)
compiler: sparc64-linux-gcc (GCC) 12.3.0
reproduce: (https://download.01.org/0day-ci/archive/20230729/202307290758.YrrAnTBI-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@intel.com>
| Closes: https://lore.kernel.org/r/202307290758.YrrAnTBI-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> drivers/hwmon/bt1-pvt.c:354:24: sparse: sparse: bad integer constant expression
>> drivers/hwmon/bt1-pvt.c:354:24: sparse: sparse: static assertion failed: "clamp() low limit (typeof(data))(0) greater than high limit (typeof(data))(limit)"
   drivers/hwmon/bt1-pvt.c:359:24: sparse: sparse: bad integer constant expression
>> drivers/hwmon/bt1-pvt.c:359:24: sparse: sparse: static assertion failed: "clamp() low limit (typeof(data))(limit) greater than high limit (typeof(data))(((((0)) + (((~(((0UL)))) - ((((1UL))) << (0)) + 1) & (~(((0UL))) >> (64 - 1 - (9))))) >> 0))"
--
>> drivers/powercap/arm_scmi_powercap.c:107:17: sparse: sparse: bad integer constant expression
>> drivers/powercap/arm_scmi_powercap.c:107:17: sparse: sparse: static assertion failed: "clamp() low limit (u32)(spz->info->min_power_cap) greater than high limit (u32)(spz->info->max_power_cap)"
   drivers/powercap/arm_scmi_powercap.c:158:17: sparse: sparse: bad integer constant expression
>> drivers/powercap/arm_scmi_powercap.c:158:17: sparse: sparse: static assertion failed: "clamp() low limit (u32)(spz->info->min_pai) greater than high limit (u32)(spz->info->max_pai)"

vim +354 drivers/hwmon/bt1-pvt.c

87976ce2825d9f Serge Semin   2020-05-28  330  
87976ce2825d9f Serge Semin   2020-05-28  331  static int pvt_write_limit(struct pvt_hwmon *pvt, enum pvt_sensor_type type,
87976ce2825d9f Serge Semin   2020-05-28  332  			   bool is_low, long val)
87976ce2825d9f Serge Semin   2020-05-28  333  {
87976ce2825d9f Serge Semin   2020-05-28  334  	u32 data, limit, mask;
87976ce2825d9f Serge Semin   2020-05-28  335  	int ret;
87976ce2825d9f Serge Semin   2020-05-28  336  
87976ce2825d9f Serge Semin   2020-05-28  337  	if (type == PVT_TEMP) {
87976ce2825d9f Serge Semin   2020-05-28  338  		val = clamp(val, PVT_TEMP_MIN, PVT_TEMP_MAX);
e0daf1a60ed478 Michael Walle 2022-04-01  339  		data = polynomial_calc(&poly_temp_to_N, val);
87976ce2825d9f Serge Semin   2020-05-28  340  	} else {
87976ce2825d9f Serge Semin   2020-05-28  341  		val = clamp(val, PVT_VOLT_MIN, PVT_VOLT_MAX);
e0daf1a60ed478 Michael Walle 2022-04-01  342  		data = polynomial_calc(&poly_volt_to_N, val);
87976ce2825d9f Serge Semin   2020-05-28  343  	}
87976ce2825d9f Serge Semin   2020-05-28  344  
87976ce2825d9f Serge Semin   2020-05-28  345  	/* Serialize limit update, since a part of the register is changed. */
87976ce2825d9f Serge Semin   2020-05-28  346  	ret = mutex_lock_interruptible(&pvt->iface_mtx);
87976ce2825d9f Serge Semin   2020-05-28  347  	if (ret)
87976ce2825d9f Serge Semin   2020-05-28  348  		return ret;
87976ce2825d9f Serge Semin   2020-05-28  349  
87976ce2825d9f Serge Semin   2020-05-28  350  	/* Make sure the upper and lower ranges don't intersect. */
87976ce2825d9f Serge Semin   2020-05-28  351  	limit = readl(pvt->regs + pvt_info[type].thres_base);
87976ce2825d9f Serge Semin   2020-05-28  352  	if (is_low) {
87976ce2825d9f Serge Semin   2020-05-28  353  		limit = FIELD_GET(PVT_THRES_HI_MASK, limit);
87976ce2825d9f Serge Semin   2020-05-28 @354  		data = clamp_val(data, PVT_DATA_MIN, limit);
87976ce2825d9f Serge Semin   2020-05-28  355  		data = FIELD_PREP(PVT_THRES_LO_MASK, data);
87976ce2825d9f Serge Semin   2020-05-28  356  		mask = PVT_THRES_LO_MASK;
87976ce2825d9f Serge Semin   2020-05-28  357  	} else {
87976ce2825d9f Serge Semin   2020-05-28  358  		limit = FIELD_GET(PVT_THRES_LO_MASK, limit);
87976ce2825d9f Serge Semin   2020-05-28 @359  		data = clamp_val(data, limit, PVT_DATA_MAX);
87976ce2825d9f Serge Semin   2020-05-28  360  		data = FIELD_PREP(PVT_THRES_HI_MASK, data);
87976ce2825d9f Serge Semin   2020-05-28  361  		mask = PVT_THRES_HI_MASK;
87976ce2825d9f Serge Semin   2020-05-28  362  	}
87976ce2825d9f Serge Semin   2020-05-28  363  
87976ce2825d9f Serge Semin   2020-05-28  364  	pvt_update(pvt->regs + pvt_info[type].thres_base, mask, data);
87976ce2825d9f Serge Semin   2020-05-28  365  
87976ce2825d9f Serge Semin   2020-05-28  366  	mutex_unlock(&pvt->iface_mtx);
87976ce2825d9f Serge Semin   2020-05-28  367  
87976ce2825d9f Serge Semin   2020-05-28  368  	return 0;
87976ce2825d9f Serge Semin   2020-05-28  369  }
87976ce2825d9f Serge Semin   2020-05-28  370  

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

             reply	other threads:[~2023-07-28 23:48 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-28 23:47 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-07-31 21:23 [PATCH next resend 2/5] minmax: Allow min()/max()/clamp() if the arguments have the same signedness kernel test robot
2023-07-31 20:41 kernel test robot
2023-07-31 20:20 kernel test robot
2023-07-30  1:38 kernel test robot
2023-07-30  1:08 kernel test robot
2023-07-29  3:54 kernel test robot
2023-07-29  2:41 kernel test robot
2023-07-29  2:00 kernel test robot
2023-07-29  1:19 kernel test robot
2023-07-28 10:25 kernel test robot
2023-07-28  9:53 kernel test robot
2023-07-27 21:24 kernel test robot
2023-07-27 12:37 kernel test robot
2023-07-27  3:27 kernel test robot
2023-07-26 23:47 kernel test robot
2023-07-26 21:10 kernel test robot
2023-07-26 19:58 kernel test robot
2023-07-26 12:15 kernel test robot
2023-07-26  9:50 kernel test robot
2023-07-26  9:39 kernel test robot
2023-07-26  9:29 kernel test robot
2023-07-26  8:47 kernel test robot
2023-07-26  8:36 kernel test robot
2023-07-26  8:05 kernel test robot
2023-07-25 10:00 [PATCH next 0/5] minmax: Relax type checks in min() and max() David Laight
2023-07-25 11:51 ` [PATCH next resend 2/5] minmax: Allow min()/max()/clamp() if the arguments have the same signedness David Laight
2023-07-25 18:02   ` kernel test robot
2023-07-25 18:33   ` kernel test robot
2023-07-26  9:19     ` David Laight
2023-07-26  9:50       ` Marc Zyngier
2023-07-26 10:25         ` David Laight

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=202307290758.YrrAnTBI-lkp@intel.com \
    --to=lkp@intel.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.