All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: "Thomas Weißschuh " <linux@weissschuh.net>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: [thomas-weissschuh:b4/cros_ec-hwmon-fan-curve 6/8] drivers/hwmon/cros_ec_hwmon.c:426:11: warning: result of comparison of constant 9223372036854775807 with expression of type 'u32' (aka 'unsigned int') is always false
Date: Tue, 16 Jun 2026 06:08:17 +0800	[thread overview]
Message-ID: <202606160631.PYJS1WF9-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/thomas.weissschuh/linux.git b4/cros_ec-hwmon-fan-curve
head:   582a1b36e53f5d5ee673ad6414dd5c643373093b
commit: 0bd9cb0132cfadeb570112043e378431fe8b6484 [6/8] hwmon: (cros_ec) Add support for displaying fan curves
config: s390-allmodconfig (https://download.01.org/0day-ci/archive/20260616/202606160631.PYJS1WF9-lkp@intel.com/config)
compiler: clang version 23.0.0git (https://github.com/llvm/llvm-project e19d1f51a2c80b63cd8ca95bcc757b7077112808)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260616/202606160631.PYJS1WF9-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/oe-kbuild-all/202606160631.PYJS1WF9-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/hwmon/cros_ec_hwmon.c:426:11: warning: result of comparison of constant 9223372036854775807 with expression of type 'u32' (aka 'unsigned int') is always false [-Wtautological-constant-out-of-range-compare]
     426 |         if (temp > LONG_MAX || cros_ec_hwmon_kelvin_to_millicelsius(temp, &temp_millicelsius))
         |             ~~~~ ^ ~~~~~~~~
   1 warning generated.


vim +426 drivers/hwmon/cros_ec_hwmon.c

   401	
   402	static ssize_t temp_auto_point_temp_show(struct device *dev, struct device_attribute *attr,
   403						 char *buf)
   404	{
   405		struct sensor_device_attribute_2 *sattr = to_sensor_dev_attr_2(attr);
   406		struct cros_ec_hwmon_priv *priv = dev_get_drvdata(dev);
   407		struct ec_thermal_config config;
   408		long temp_millicelsius;
   409		u32 temp;
   410		int ret;
   411	
   412		scoped_guard(hwmon_lock, dev) {
   413			ret = cros_ec_hwmon_get_thermal_config(priv->cros_ec, sattr->index, &config);
   414			if (ret)
   415				return ret;
   416		}
   417	
   418		if (cros_ec_hwmon_attr_is_temp_fan_off(sattr))
   419			temp = config.temp_fan_off;
   420		else /* temp_fan_max */
   421			temp = config.temp_fan_max;
   422	
   423		if (temp == 0)
   424			return -ENODATA;
   425	
 > 426		if (temp > LONG_MAX || cros_ec_hwmon_kelvin_to_millicelsius(temp, &temp_millicelsius))
   427			return -ERANGE;
   428	
   429		return sysfs_emit(buf, "%ld\n", temp_millicelsius);
   430	}
   431	

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

                 reply	other threads:[~2026-06-15 22:08 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202606160631.PYJS1WF9-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=linux@weissschuh.net \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@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.