From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: [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'
Date: Wed, 16 Dec 2020 05:15:33 +0800 [thread overview]
Message-ID: <202012160530.yO2M718w-lkp@intel.com> (raw)
[-- 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 --]
reply other threads:[~2020-12-15 21:15 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=202012160530.yO2M718w-lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild-all@lists.01.org \
/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.