* [tip:timers/core 5/5] kernel/time/timekeeping.c:220:7: warning: comparison of distinct pointer types ('unsigned long *' and 'typeof (tk->last_warning + (100 * 300)) *' (aka 'long *'))
@ 2024-08-24 9:58 kernel test robot
2024-08-25 17:31 ` Thomas Gleixner
0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2024-08-24 9:58 UTC (permalink / raw)
To: Chen Yufan; +Cc: llvm, oe-kbuild-all, linux-kernel, x86, Thomas Gleixner
tree: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git timers/core
head: 42db2c2cb5ac3572380a9489b8f8bbe0e534dfc7
commit: 42db2c2cb5ac3572380a9489b8f8bbe0e534dfc7 [5/5] timekeeping: Use time_after() in timekeeping_check_update()
config: i386-buildonly-randconfig-002-20240824 (https://download.01.org/0day-ci/archive/20240824/202408241701.NSEI3MOV-lkp@intel.com/config)
compiler: clang version 18.1.5 (https://github.com/llvm/llvm-project 617a15a9eac96088ae5e9134248d8236e34b91b1)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240824/202408241701.NSEI3MOV-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/202408241701.NSEI3MOV-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> kernel/time/timekeeping.c:220:7: warning: comparison of distinct pointer types ('unsigned long *' and 'typeof (tk->last_warning + (100 * 300)) *' (aka 'long *')) [-Wcompare-distinct-pointer-types]
220 | if (time_after(jiffies, tk->last_warning + WARNING_FREQ)) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/jiffies.h:129:3: note: expanded from macro 'time_after'
129 | typecheck(unsigned long, b) && \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/typecheck.h:12:18: note: expanded from macro 'typecheck'
12 | (void)(&__dummy == &__dummy2); \
| ~~~~~~~~ ^ ~~~~~~~~~
kernel/time/timekeeping.c:230:7: warning: comparison of distinct pointer types ('unsigned long *' and 'typeof (tk->last_warning + (100 * 300)) *' (aka 'long *')) [-Wcompare-distinct-pointer-types]
230 | if (time_after(jiffies, tk->last_warning + WARNING_FREQ)) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/jiffies.h:129:3: note: expanded from macro 'time_after'
129 | typecheck(unsigned long, b) && \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/typecheck.h:12:18: note: expanded from macro 'typecheck'
12 | (void)(&__dummy == &__dummy2); \
| ~~~~~~~~ ^ ~~~~~~~~~
2 warnings generated.
vim +220 kernel/time/timekeeping.c
203
204 u64 max_cycles = tk->tkr_mono.clock->max_cycles;
205 const char *name = tk->tkr_mono.clock->name;
206
207 if (offset > max_cycles) {
208 printk_deferred("WARNING: timekeeping: Cycle offset (%lld) is larger than allowed by the '%s' clock's max_cycles value (%lld): time overflow danger\n",
209 offset, name, max_cycles);
210 printk_deferred(" timekeeping: Your kernel is sick, but tries to cope by capping time updates\n");
211 } else {
212 if (offset > (max_cycles >> 1)) {
213 printk_deferred("INFO: timekeeping: Cycle offset (%lld) is larger than the '%s' clock's 50%% safety margin (%lld)\n",
214 offset, name, max_cycles >> 1);
215 printk_deferred(" timekeeping: Your kernel is still fine, but is feeling a bit nervous\n");
216 }
217 }
218
219 if (tk->underflow_seen) {
> 220 if (time_after(jiffies, tk->last_warning + WARNING_FREQ)) {
221 printk_deferred("WARNING: Underflow in clocksource '%s' observed, time update ignored.\n", name);
222 printk_deferred(" Please report this, consider using a different clocksource, if possible.\n");
223 printk_deferred(" Your kernel is probably still fine.\n");
224 tk->last_warning = jiffies;
225 }
226 tk->underflow_seen = 0;
227 }
228
229 if (tk->overflow_seen) {
230 if (time_after(jiffies, tk->last_warning + WARNING_FREQ)) {
231 printk_deferred("WARNING: Overflow in clocksource '%s' observed, time update capped.\n", name);
232 printk_deferred(" Please report this, consider using a different clocksource, if possible.\n");
233 printk_deferred(" Your kernel is probably still fine.\n");
234 tk->last_warning = jiffies;
235 }
236 tk->overflow_seen = 0;
237 }
238 }
239
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [tip:timers/core 5/5] kernel/time/timekeeping.c:220:7: warning: comparison of distinct pointer types ('unsigned long *' and 'typeof (tk->last_warning + (100 * 300)) *' (aka 'long *'))
2024-08-24 9:58 [tip:timers/core 5/5] kernel/time/timekeeping.c:220:7: warning: comparison of distinct pointer types ('unsigned long *' and 'typeof (tk->last_warning + (100 * 300)) *' (aka 'long *')) kernel test robot
@ 2024-08-25 17:31 ` Thomas Gleixner
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Gleixner @ 2024-08-25 17:31 UTC (permalink / raw)
To: kernel test robot, Chen Yufan; +Cc: llvm, oe-kbuild-all, linux-kernel, x86
On Sat, Aug 24 2024 at 17:58, kernel test robot wrote:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git timers/core
> head: 42db2c2cb5ac3572380a9489b8f8bbe0e534dfc7
> commit: 42db2c2cb5ac3572380a9489b8f8bbe0e534dfc7 [5/5] timekeeping: Use time_after() in timekeeping_check_update()
> config: i386-buildonly-randconfig-002-20240824 (https://download.01.org/0day-ci/archive/20240824/202408241701.NSEI3MOV-lkp@intel.com/config)
> compiler: clang version 18.1.5 (https://github.com/llvm/llvm-project 617a15a9eac96088ae5e9134248d8236e34b91b1)
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240824/202408241701.NSEI3MOV-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/202408241701.NSEI3MOV-lkp@intel.com/
>
> All warnings (new ones prefixed by >>):
>
>>> kernel/time/timekeeping.c:220:7: warning: comparison of distinct pointer types ('unsigned long *' and 'typeof (tk->last_warning + (100 * 300)) *' (aka 'long *')) [-Wcompare-distinct-pointer-types]
> 220 | if (time_after(jiffies, tk->last_warning + WARNING_FREQ)) {
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Indeed. For that to work tk->last_warning must me changed to unsigned
long. Zapped the commit for now.
Thanks,
tglx
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-08-25 17:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-24 9:58 [tip:timers/core 5/5] kernel/time/timekeeping.c:220:7: warning: comparison of distinct pointer types ('unsigned long *' and 'typeof (tk->last_warning + (100 * 300)) *' (aka 'long *')) kernel test robot
2024-08-25 17:31 ` Thomas Gleixner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox