LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [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'
@ 2021-09-02 23:13 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-09-02 23:13 UTC (permalink / raw)
  To: Paul E. McKenney; +Cc: kbuild-all, linux-kernel

[-- 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 --]

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

only message in thread, other threads:[~2021-09-02 23:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-02 23:13 [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' kernel test robot

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).