[net:master 45/81] drivers/ptp/ptp_sysfs.c:182:9: warning: %d in format string (no. 1) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint]

From: kernel test robot <hidden>
Date: 2021-07-05 08:57:07
Also in: oe-kbuild-all

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git master
head:   b43c8909be52f2baca8884f967b418a88424494a
commit: 73f37068d540eba5f93ba3a0019bf479d35ebd76 [45/81] ptp: support ptp physical/virtual clocks conversion
compiler: h8300-linux-gcc (GCC) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <redacted>

cppcheck warnings: (new ones prefixed by >>)
quoted
drivers/ptp/ptp_sysfs.c:182:9: warning: %d in format string (no. 1) requires 'int' but the argument type is 'unsigned int'. [invalidPrintfArgType_sint]
vim +182 drivers/ptp/ptp_sysfs.c

73f37068d540eb Yangbo Lu 2021-06-30  172  
73f37068d540eb Yangbo Lu 2021-06-30  173  static ssize_t n_vclocks_show(struct device *dev,
73f37068d540eb Yangbo Lu 2021-06-30  174  			      struct device_attribute *attr, char *page)
73f37068d540eb Yangbo Lu 2021-06-30  175  {
73f37068d540eb Yangbo Lu 2021-06-30  176  	struct ptp_clock *ptp = dev_get_drvdata(dev);
73f37068d540eb Yangbo Lu 2021-06-30  177  	ssize_t size;
73f37068d540eb Yangbo Lu 2021-06-30  178  
73f37068d540eb Yangbo Lu 2021-06-30  179  	if (mutex_lock_interruptible(&ptp->n_vclocks_mux))
73f37068d540eb Yangbo Lu 2021-06-30  180  		return -ERESTARTSYS;
73f37068d540eb Yangbo Lu 2021-06-30  181  
73f37068d540eb Yangbo Lu 2021-06-30 @182  	size = snprintf(page, PAGE_SIZE - 1, "%d\n", ptp->n_vclocks);
73f37068d540eb Yangbo Lu 2021-06-30  183  
73f37068d540eb Yangbo Lu 2021-06-30  184  	mutex_unlock(&ptp->n_vclocks_mux);
73f37068d540eb Yangbo Lu 2021-06-30  185  
73f37068d540eb Yangbo Lu 2021-06-30  186  	return size;
73f37068d540eb Yangbo Lu 2021-06-30  187  }
73f37068d540eb Yangbo Lu 2021-06-30  188  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help