public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
* [tglx-devel:cleanups 15/38] drivers/ptp/ptp_vmclock.c:687:5: warning: format specifies type 'unsigned long long' but the argument has type 'resource_size_t' (aka 'unsigned int')
@ 2026-04-11  1:40 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-04-11  1:40 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: llvm, oe-kbuild-all

Hi Thomas,

First bad commit (maybe != root cause):

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git cleanups
head:   4f7b68811bb6be347b794010429e839e7a23b9d8
commit: 7fb0a26394a1f8378dcf335ea5ad47d32621e080 [15/38] ptp: ptp_vmclock: Replace get_cycles() usage
config: i386-defconfig (https://download.01.org/0day-ci/archive/20260411/202604110913.TD4h4vVK-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260411/202604110913.TD4h4vVK-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/202604110913.TD4h4vVK-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/ptp/ptp_vmclock.c:78:11: error: __int128 is not supported on this target
      78 |         unsigned __int128 res = (unsigned __int128)delta * period;
         |                  ^
   drivers/ptp/ptp_vmclock.c:78:36: error: __int128 is not supported on this target
      78 |         unsigned __int128 res = (unsigned __int128)delta * period;
         |                                           ^
>> drivers/ptp/ptp_vmclock.c:687:5: warning: format specifies type 'unsigned long long' but the argument has type 'resource_size_t' (aka 'unsigned int') [-Wformat]
     686 |                 dev_info(dev, "Region too small (0x%llx)\n",
         |                                                    ~~~~
         |                                                    %x
     687 |                          resource_size(&st->res));
         |                          ^~~~~~~~~~~~~~~~~~~~~~~
   include/linux/dev_printk.h:160:67: note: expanded from macro 'dev_info'
     160 |         dev_printk_index_wrap(_dev_info, KERN_INFO, dev, dev_fmt(fmt), ##__VA_ARGS__)
         |                                                                  ~~~     ^~~~~~~~~~~
   include/linux/dev_printk.h:110:23: note: expanded from macro 'dev_printk_index_wrap'
     110 |                 _p_func(dev, fmt, ##__VA_ARGS__);                       \
         |                              ~~~    ^~~~~~~~~~~
   1 warning and 2 errors generated.


vim +687 drivers/ptp/ptp_vmclock.c

20503272422693 David Woodhouse  2024-10-06  662  
20503272422693 David Woodhouse  2024-10-06  663  static int vmclock_probe(struct platform_device *pdev)
20503272422693 David Woodhouse  2024-10-06  664  {
20503272422693 David Woodhouse  2024-10-06  665  	struct device *dev = &pdev->dev;
20503272422693 David Woodhouse  2024-10-06  666  	struct vmclock_state *st;
20503272422693 David Woodhouse  2024-10-06  667  	int ret;
20503272422693 David Woodhouse  2024-10-06  668  
20503272422693 David Woodhouse  2024-10-06  669  	st = devm_kzalloc(dev, sizeof(*st), GFP_KERNEL);
20503272422693 David Woodhouse  2024-10-06  670  	if (!st)
20503272422693 David Woodhouse  2024-10-06  671  		return -ENOMEM;
20503272422693 David Woodhouse  2024-10-06  672  
ac1e7404924cb4 David Woodhouse  2026-01-30  673  #if IS_ENABLED(CONFIG_ACPI)
20503272422693 David Woodhouse  2024-10-06  674  	if (has_acpi_companion(dev))
20503272422693 David Woodhouse  2024-10-06  675  		ret = vmclock_probe_acpi(dev, st);
20503272422693 David Woodhouse  2024-10-06  676  	else
ac1e7404924cb4 David Woodhouse  2026-01-30  677  #endif
ddc867d0b5db6f David Woodhouse  2026-01-30  678  		ret = vmclock_probe_dt(dev, st);
20503272422693 David Woodhouse  2024-10-06  679  
20503272422693 David Woodhouse  2024-10-06  680  	if (ret) {
20503272422693 David Woodhouse  2024-10-06  681  		dev_info(dev, "Failed to obtain physical address: %d\n", ret);
b4c1fde5ced93d Thomas Weißschuh 2025-02-07  682  		return ret;
20503272422693 David Woodhouse  2024-10-06  683  	}
20503272422693 David Woodhouse  2024-10-06  684  
20503272422693 David Woodhouse  2024-10-06  685  	if (resource_size(&st->res) < VMCLOCK_MIN_SIZE) {
20503272422693 David Woodhouse  2024-10-06  686  		dev_info(dev, "Region too small (0x%llx)\n",
20503272422693 David Woodhouse  2024-10-06 @687  			 resource_size(&st->res));
b4c1fde5ced93d Thomas Weißschuh 2025-02-07  688  		return -EINVAL;
20503272422693 David Woodhouse  2024-10-06  689  	}
20503272422693 David Woodhouse  2024-10-06  690  	st->clk = devm_memremap(dev, st->res.start, resource_size(&st->res),
20503272422693 David Woodhouse  2024-10-06  691  				MEMREMAP_WB | MEMREMAP_DEC);
20503272422693 David Woodhouse  2024-10-06  692  	if (IS_ERR(st->clk)) {
20503272422693 David Woodhouse  2024-10-06  693  		ret = PTR_ERR(st->clk);
20503272422693 David Woodhouse  2024-10-06  694  		dev_info(dev, "failed to map shared memory\n");
20503272422693 David Woodhouse  2024-10-06  695  		st->clk = NULL;
b4c1fde5ced93d Thomas Weißschuh 2025-02-07  696  		return ret;
20503272422693 David Woodhouse  2024-10-06  697  	}
20503272422693 David Woodhouse  2024-10-06  698  
20503272422693 David Woodhouse  2024-10-06  699  	if (le32_to_cpu(st->clk->magic) != VMCLOCK_MAGIC ||
20503272422693 David Woodhouse  2024-10-06  700  	    le32_to_cpu(st->clk->size) > resource_size(&st->res) ||
20503272422693 David Woodhouse  2024-10-06  701  	    le16_to_cpu(st->clk->version) != 1) {
20503272422693 David Woodhouse  2024-10-06  702  		dev_info(dev, "vmclock magic fields invalid\n");
b4c1fde5ced93d Thomas Weißschuh 2025-02-07  703  		return -EINVAL;
20503272422693 David Woodhouse  2024-10-06  704  	}
20503272422693 David Woodhouse  2024-10-06  705  
20503272422693 David Woodhouse  2024-10-06  706  	ret = ida_alloc(&vmclock_ida, GFP_KERNEL);
20503272422693 David Woodhouse  2024-10-06  707  	if (ret < 0)
b4c1fde5ced93d Thomas Weißschuh 2025-02-07  708  		return ret;
20503272422693 David Woodhouse  2024-10-06  709  
20503272422693 David Woodhouse  2024-10-06  710  	st->index = ret;
20503272422693 David Woodhouse  2024-10-06  711  	ret = devm_add_action_or_reset(&pdev->dev, vmclock_put_idx, st);
20503272422693 David Woodhouse  2024-10-06  712  	if (ret)
b4c1fde5ced93d Thomas Weißschuh 2025-02-07  713  		return ret;
20503272422693 David Woodhouse  2024-10-06  714  
20503272422693 David Woodhouse  2024-10-06  715  	st->name = devm_kasprintf(&pdev->dev, GFP_KERNEL, "vmclock%d", st->index);
b4c1fde5ced93d Thomas Weißschuh 2025-02-07  716  	if (!st->name)
b4c1fde5ced93d Thomas Weißschuh 2025-02-07  717  		return -ENOMEM;
20503272422693 David Woodhouse  2024-10-06  718  
39e926c3a21b25 Thomas Weißschuh 2025-02-07  719  	st->miscdev.minor = MISC_DYNAMIC_MINOR;
39e926c3a21b25 Thomas Weißschuh 2025-02-07  720  
3b1526ddb25452 Babis Chalios    2026-01-30  721  	init_waitqueue_head(&st->disrupt_wait);
3b1526ddb25452 Babis Chalios    2026-01-30  722  	dev->driver_data = st;
3b1526ddb25452 Babis Chalios    2026-01-30  723  
3b1526ddb25452 Babis Chalios    2026-01-30  724  	ret = devm_add_action_or_reset(&pdev->dev, vmclock_remove, dev);
3b1526ddb25452 Babis Chalios    2026-01-30  725  	if (ret)
3b1526ddb25452 Babis Chalios    2026-01-30  726  		return ret;
3b1526ddb25452 Babis Chalios    2026-01-30  727  
3b1526ddb25452 Babis Chalios    2026-01-30  728  	ret = vmclock_setup_notification(dev, st);
9a884c3800b207 Thomas Weißschuh 2025-02-07  729  	if (ret)
b4c1fde5ced93d Thomas Weißschuh 2025-02-07  730  		return ret;
9a884c3800b207 Thomas Weißschuh 2025-02-07  731  
20503272422693 David Woodhouse  2024-10-06  732  	/*
20503272422693 David Woodhouse  2024-10-06  733  	 * If the structure is big enough, it can be mapped to userspace.
20503272422693 David Woodhouse  2024-10-06  734  	 * Theoretically a guest OS even using larger pages could still
20503272422693 David Woodhouse  2024-10-06  735  	 * use 4KiB PTEs to map smaller MMIO regions like this, but let's
20503272422693 David Woodhouse  2024-10-06  736  	 * cross that bridge if/when we come to it.
20503272422693 David Woodhouse  2024-10-06  737  	 */
20503272422693 David Woodhouse  2024-10-06  738  	if (le32_to_cpu(st->clk->size) >= PAGE_SIZE) {
20503272422693 David Woodhouse  2024-10-06  739  		st->miscdev.fops = &vmclock_miscdev_fops;
20503272422693 David Woodhouse  2024-10-06  740  		st->miscdev.name = st->name;
20503272422693 David Woodhouse  2024-10-06  741  
20503272422693 David Woodhouse  2024-10-06  742  		ret = misc_register(&st->miscdev);
20503272422693 David Woodhouse  2024-10-06  743  		if (ret)
b4c1fde5ced93d Thomas Weißschuh 2025-02-07  744  			return ret;
20503272422693 David Woodhouse  2024-10-06  745  	}
20503272422693 David Woodhouse  2024-10-06  746  
20503272422693 David Woodhouse  2024-10-06  747  	/* If there is valid clock information, register a PTP clock */
20503272422693 David Woodhouse  2024-10-06  748  	if (VMCLOCK_FIELD_PRESENT(st->clk, time_frac_sec)) {
20503272422693 David Woodhouse  2024-10-06  749  		/* Can return a silent NULL, or an error. */
20503272422693 David Woodhouse  2024-10-06  750  		st->ptp_clock = vmclock_ptp_register(dev, st);
20503272422693 David Woodhouse  2024-10-06  751  		if (IS_ERR(st->ptp_clock)) {
20503272422693 David Woodhouse  2024-10-06  752  			ret = PTR_ERR(st->ptp_clock);
20503272422693 David Woodhouse  2024-10-06  753  			st->ptp_clock = NULL;
b4c1fde5ced93d Thomas Weißschuh 2025-02-07  754  			return ret;
20503272422693 David Woodhouse  2024-10-06  755  		}
20503272422693 David Woodhouse  2024-10-06  756  	}
20503272422693 David Woodhouse  2024-10-06  757  
20503272422693 David Woodhouse  2024-10-06  758  	if (!st->miscdev.minor && !st->ptp_clock) {
20503272422693 David Woodhouse  2024-10-06  759  		/* Neither miscdev nor PTP registered */
20503272422693 David Woodhouse  2024-10-06  760  		dev_info(dev, "vmclock: Neither miscdev nor PTP available; not registering\n");
b4c1fde5ced93d Thomas Weißschuh 2025-02-07  761  		return -ENODEV;
20503272422693 David Woodhouse  2024-10-06  762  	}
20503272422693 David Woodhouse  2024-10-06  763  
20503272422693 David Woodhouse  2024-10-06  764  	dev_info(dev, "%s: registered %s%s%s\n", st->name,
20503272422693 David Woodhouse  2024-10-06  765  		 st->miscdev.minor ? "miscdev" : "",
20503272422693 David Woodhouse  2024-10-06  766  		 (st->miscdev.minor && st->ptp_clock) ? ", " : "",
20503272422693 David Woodhouse  2024-10-06  767  		 st->ptp_clock ? "PTP" : "");
20503272422693 David Woodhouse  2024-10-06  768  
b4c1fde5ced93d Thomas Weißschuh 2025-02-07  769  	return 0;
20503272422693 David Woodhouse  2024-10-06  770  }
20503272422693 David Woodhouse  2024-10-06  771  

:::::: The code at line 687 was first introduced by commit
:::::: 20503272422693d793b84f88bf23fe4e955d3a33 ptp: Add support for the AMZNC10C 'vmclock' device

:::::: TO: David Woodhouse <dwmw@amazon.co.uk>
:::::: CC: David S. Miller <davem@davemloft.net>

-- 
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-04-11  1:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-11  1:40 [tglx-devel:cleanups 15/38] drivers/ptp/ptp_vmclock.c:687:5: warning: format specifies type 'unsigned long long' but the argument has type 'resource_size_t' (aka 'unsigned int') 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