drivers/ptp/ptp_vmclock.c:445:24: sparse: sparse: incorrect type in return expression (different base types)
From: kernel test robot
Date: Wed Mar 11 2026 - 11:47:38 EST
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: b29fb8829bff243512bb8c8908fd39406f9fd4c3
commit: 3b1526ddb25452385b52f2588b655f524a57070b ptp: vmclock: support device notifications
date: 5 weeks ago
config: x86_64-randconfig-123-20260311 (https://download.01.org/0day-ci/archive/20260311/202603112306.7c5SVcUv-lkp@xxxxxxxxx/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
sparse: v0.6.5-rc1
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260311/202603112306.7c5SVcUv-lkp@xxxxxxxxx/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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202603112306.7c5SVcUv-lkp@xxxxxxxxx/
sparse warnings: (new ones prefixed by >>)
>> drivers/ptp/ptp_vmclock.c:445:24: sparse: sparse: incorrect type in return expression (different base types) @@ expected restricted __poll_t @@ got int @@
drivers/ptp/ptp_vmclock.c:445:24: sparse: expected restricted __poll_t
drivers/ptp/ptp_vmclock.c:445:24: sparse: got int
drivers/ptp/ptp_vmclock.c:451:31: sparse: sparse: incorrect type in return expression (different base types) @@ expected restricted __poll_t @@ got int @@
drivers/ptp/ptp_vmclock.c:451:31: sparse: expected restricted __poll_t
drivers/ptp/ptp_vmclock.c:451:31: sparse: got int
vim +445 drivers/ptp/ptp_vmclock.c
433
434 static __poll_t vmclock_miscdev_poll(struct file *fp, poll_table *wait)
435 {
436 struct vmclock_file_state *fst = fp->private_data;
437 struct vmclock_state *st = fst->st;
438 uint32_t seq;
439
440 /*
441 * Hypervisor will not send us any notifications, so fail immediately
442 * to avoid having caller sleeping for ever.
443 */
444 if (!(le64_to_cpu(st->clk->flags) & VMCLOCK_FLAG_NOTIFICATION_PRESENT))
> 445 return POLLHUP;
446
447 poll_wait(fp, &st->disrupt_wait, wait);
448
449 seq = le32_to_cpu(st->clk->seq_count);
450 if (atomic_read(&fst->seq) != seq)
451 return POLLIN | POLLRDNORM;
452
453 return 0;
454 }
455
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki