* [thomas-weissschuh:b4/auxclock-nanosleep 17/42] kernel/time/aux_clock_test.c:184:18: warning: overflow in expression; result is 705'032'704 with type 'long'
@ 2026-09-11 10:04 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-09-11 10:04 UTC (permalink / raw)
To: Thomas Weißschuh (Schneider Electric); +Cc: oe-kbuild-all
tree: https://git.kernel.org/pub/scm/linux/kernel/git/thomas.weissschuh/linux.git b4/auxclock-nanosleep
head: 368883ddc7ac709883254193a4588fdf9b2da65a
commit: 05ab3171697e70cdc4302f27ef62d851a2580f93 [17/42] timekeeping: Add a test for auxiliary to monotonic clock conversions
config: i386-randconfig-051-20260911 (https://download.01.org/0day-ci/archive/20260911/202609111102.lkBGAFl6-lkp@intel.com/config)
compiler: clang version 22.1.8 (https://github.com/llvm/llvm-project ca7933e47d3a3451d81e72ac174dcb5aa28b59d1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260911/202609111102.lkBGAFl6-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/202609111102.lkBGAFl6-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> kernel/time/aux_clock_test.c:184:18: warning: overflow in expression; result is 705'032'704 with type 'long' [-Winteger-overflow]
184 | small_delta = 5 * NSEC_PER_SEC;
| ~~^~~~~~~~~~~~~~
kernel/time/aux_clock_test.c:186:28: warning: overflow in expression; result is 765'657'088 with type 'long' [-Winteger-overflow]
186 | large_delta = 365 * 86400 * NSEC_PER_SEC;
| ~~~~~~~~~~~~^~~~~~~~~~~~~~
2 warnings generated.
vim +184 kernel/time/aux_clock_test.c
173
174 /* Mostly for development only. */
175 static void mono_conv_edge_cases(struct kunit *test)
176 {
177 ktime_t mono_base, aux_base, small_delta, large_delta;
178 struct tk_aux_mono_conv conv;
179 ktime_t converted_mono;
180 bool is_before;
181
182 mono_base = 0;
183 aux_base = 0;
> 184 small_delta = 5 * NSEC_PER_SEC;
185 /* 1 year */
186 large_delta = 365 * 86400 * NSEC_PER_SEC;
187
188 setup_aux_mono_conv(&conv, 5, mono_base, aux_base);
189
190 /* delta = 0 */
191 is_before = ktime_aux_before_mono_and_convert(&conv, aux_base, mono_base, &converted_mono);
192 KUNIT_EXPECT_FALSE(test, is_before);
193
194 is_before = ktime_aux_before_mono_and_convert(&conv, aux_base, mono_base + 1,
195 &converted_mono);
196 KUNIT_EXPECT_TRUE(test, is_before);
197 KUNIT_EXPECT_EQ(test, converted_mono, mono_base);
198
199 /* positive small delta */
200 is_before = ktime_aux_before_mono_and_convert(&conv, aux_base + small_delta, mono_base,
201 &converted_mono);
202 KUNIT_EXPECT_FALSE(test, is_before);
203
204 is_before = ktime_aux_before_mono_and_convert(&conv, aux_base, mono_base + small_delta,
205 &converted_mono);
206 KUNIT_EXPECT_TRUE(test, is_before);
207 KUNIT_EXPECT_EQ(test, converted_mono, mono_base);
208
209 /* positive large delta */
210 is_before = ktime_aux_before_mono_and_convert(&conv, aux_base + large_delta, mono_base,
211 &converted_mono);
212 KUNIT_EXPECT_FALSE(test, is_before);
213
214 is_before = ktime_aux_before_mono_and_convert(&conv, aux_base, mono_base + large_delta,
215 &converted_mono);
216 KUNIT_EXPECT_TRUE(test, is_before);
217 KUNIT_EXPECT_EQ(test, converted_mono, mono_base);
218
219 /* negative small delta */
220 is_before = ktime_aux_before_mono_and_convert(&conv, aux_base - small_delta, mono_base,
221 &converted_mono);
222 KUNIT_EXPECT_TRUE(test, is_before);
223 KUNIT_EXPECT_EQ(test, converted_mono, -4761904702);
224
225 is_before = ktime_aux_before_mono_and_convert(&conv, aux_base, mono_base - small_delta,
226 &converted_mono);
227 KUNIT_EXPECT_FALSE(test, is_before);
228
229 /* negative large delta */
230 is_before = ktime_aux_before_mono_and_convert(&conv, aux_base - large_delta, mono_base,
231 &converted_mono);
232 KUNIT_EXPECT_TRUE(test, is_before);
233 KUNIT_EXPECT_EQ(test, converted_mono, -30034285333871842);
234
235 is_before = ktime_aux_before_mono_and_convert(&conv, aux_base, mono_base - large_delta,
236 &converted_mono);
237 KUNIT_EXPECT_FALSE(test, is_before);
238 }
239
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-09-11 10:05 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-11 10:04 [thomas-weissschuh:b4/auxclock-nanosleep 17/42] kernel/time/aux_clock_test.c:184:18: warning: overflow in expression; result is 705'032'704 with type 'long' 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.