From: kernel test robot <lkp@intel.com>
To: "Paul E. McKenney" <paulmck@kernel.org>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org
Subject: [rcu:dev.2021.08.25a 109/115] kernel/time/tick-oneshot.c:27:55: warning: integer overflow in expression of type 'long int' results in '-1857093632'
Date: Fri, 3 Sep 2021 07:13:06 +0800 [thread overview]
Message-ID: <202109030701.i87lX52g-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 3921 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git dev.2021.08.25a
head: 2ba1d046d9bc5b4496027d120e3ddcdfbb2fe9f4
commit: cbe3af2f0b14d8998c4e4765c699c07d0da1ac2b [109/115] EXP cpu: Check for negative expires in hrtimer_reprogram() and tick_program_event()
config: nds32-allyesconfig (attached as .config)
compiler: nds32le-linux-gcc (GCC) 11.2.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/paulmck/linux-rcu.git/commit/?id=cbe3af2f0b14d8998c4e4765c699c07d0da1ac2b
git remote add rcu https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git
git fetch --no-tags rcu dev.2021.08.25a
git checkout cbe3af2f0b14d8998c4e4765c699c07d0da1ac2b
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=nds32
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 >>):
In file included from include/linux/printk.h:11,
from include/linux/kernel.h:19,
from include/linux/list.h:9,
from include/linux/rculist.h:10,
from include/linux/pid.h:5,
from include/linux/sched.h:14,
from include/linux/ratelimit.h:6,
from include/linux/dev_printk.h:16,
from include/linux/device.h:15,
from include/linux/node.h:18,
from include/linux/cpu.h:17,
from kernel/time/tick-oneshot.c:10:
kernel/time/tick-oneshot.c: In function 'tick_program_event':
>> kernel/time/tick-oneshot.c:27:55: warning: integer overflow in expression of type 'long int' results in '-1857093632' [-Woverflow]
27 | WARN_ON_ONCE(expires < -KTIME_MAX + 24 * 3600 * NSEC_PER_SEC);
| ^
include/linux/once_lite.h:15:41: note: in definition of macro 'DO_ONCE_LITE_IF'
15 | bool __ret_do_once = !!(condition); \
| ^~~~~~~~~
kernel/time/tick-oneshot.c:27:9: note: in expansion of macro 'WARN_ON_ONCE'
27 | WARN_ON_ONCE(expires < -KTIME_MAX + 24 * 3600 * NSEC_PER_SEC);
| ^~~~~~~~~~~~
vim +27 kernel/time/tick-oneshot.c
> 10 #include <linux/cpu.h>
11 #include <linux/err.h>
12 #include <linux/hrtimer.h>
13 #include <linux/interrupt.h>
14 #include <linux/percpu.h>
15 #include <linux/profile.h>
16 #include <linux/sched.h>
17
18 #include "tick-internal.h"
19
20 /**
21 * tick_program_event
22 */
23 int tick_program_event(ktime_t expires, int force)
24 {
25 struct clock_event_device *dev = __this_cpu_read(tick_cpu_device.evtdev);
26
> 27 WARN_ON_ONCE(expires < -KTIME_MAX + 24 * 3600 * NSEC_PER_SEC);
28 if (unlikely(expires == KTIME_MAX)) {
29 /*
30 * We don't need the clock event device any more, stop it.
31 */
32 clockevents_switch_state(dev, CLOCK_EVT_STATE_ONESHOT_STOPPED);
33 dev->next_event = KTIME_MAX;
34 return 0;
35 }
36
37 if (unlikely(clockevent_state_oneshot_stopped(dev))) {
38 /*
39 * We need the clock event again, configure it in ONESHOT mode
40 * before using it.
41 */
42 clockevents_switch_state(dev, CLOCK_EVT_STATE_ONESHOT);
43 }
44
45 return clockevents_program_event(dev, expires, force);
46 }
47
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 60997 bytes --]
reply other threads:[~2021-09-02 23:13 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=202109030701.i87lX52g-lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild-all@lists.01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=paulmck@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).