All of lore.kernel.org
 help / color / mirror / Atom feed
* [iio:testing 12/12] drivers/iio/trigger/iio-trig-hrtimer.c:62:33: warning: integer overflow in expression of type 'long int' results in '-727379968'
@ 2020-12-15 21:15 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2020-12-15 21:15 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 2715 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git testing
head:   e5cfcce2ab02eabe42d31fa5d29ffdbebfd48675
commit: e5cfcce2ab02eabe42d31fa5d29ffdbebfd48675 [12/12] iio: hrtimer: Allow sub Hz granularity
config: mips-allyesconfig (attached as .config)
compiler: mips-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git/commit/?id=e5cfcce2ab02eabe42d31fa5d29ffdbebfd48675
        git remote add iio https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git
        git fetch --no-tags iio testing
        git checkout e5cfcce2ab02eabe42d31fa5d29ffdbebfd48675
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=mips 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   drivers/iio/trigger/iio-trig-hrtimer.c: In function 'iio_hrtimer_store_sampling_frequency':
>> drivers/iio/trigger/iio-trig-hrtimer.c:62:33: warning: integer overflow in expression of type 'long int' results in '-727379968' [-Woverflow]
      62 |  if (!val || val > NSEC_PER_SEC * 1000)
         |                                 ^
   drivers/iio/trigger/iio-trig-hrtimer.c:67:30: warning: integer overflow in expression of type 'long int' results in '-727379968' [-Woverflow]
      67 |  info->period = NSEC_PER_SEC * 1000 / val;
         |                              ^

vim +62 drivers/iio/trigger/iio-trig-hrtimer.c

    45	
    46	static
    47	ssize_t iio_hrtimer_store_sampling_frequency(struct device *dev,
    48						     struct device_attribute *attr,
    49						     const char *buf, size_t len)
    50	{
    51		struct iio_trigger *trig = to_iio_trigger(dev);
    52		struct iio_hrtimer_info *info = iio_trigger_get_drvdata(trig);
    53		unsigned long long val;
    54		int integer, fract, ret;
    55	
    56		ret = iio_str_to_fixpoint(buf, 100, &integer, &fract);
    57		if (ret)
    58			return ret;
    59	
    60		val = fract + 1000 * integer;
    61	
  > 62		if (!val || val > NSEC_PER_SEC * 1000)
    63			return -EINVAL;
    64	
    65		info->sampling_frequency[0] = integer;
    66		info->sampling_frequency[1] = fract * 1000;
    67		info->period = NSEC_PER_SEC * 1000 / val;
    68	
    69		return len;
    70	}
    71	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 69037 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-12-15 21:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-15 21:15 [iio:testing 12/12] drivers/iio/trigger/iio-trig-hrtimer.c:62:33: warning: integer overflow in expression of type 'long int' results in '-727379968' kernel test robot

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.