llvm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [asahilinux:bits/090-spi-hid 18/19] drivers/hid/dockchannel-hid/dockchannel-hid.c:987:18: warning: format specifies type 'long' but the argument has type '__size_t' (aka 'unsigned int')
@ 2025-08-04 14:53 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-08-04 14:53 UTC (permalink / raw)
  To: Hector Martin; +Cc: llvm, oe-kbuild-all, Janne Grunau

tree:   https://github.com/AsahiLinux/linux bits/090-spi-hid
head:   17ba359286a86638c4d3a3b5bb2ba3a19db1d898
commit: 7ebaa0bb0d52e5d9c2b7967868b0e3932847b854 [18/19] HID: Add Apple DockChannel HID transport driver
config: hexagon-allyesconfig (https://download.01.org/0day-ci/archive/20250804/202508042201.aI0hBZCq-lkp@intel.com/config)
compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project 8f09b03aebb71c154f3bbe725c29e3f47d37c26e)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250804/202508042201.aI0hBZCq-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/202508042201.aI0hBZCq-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> drivers/hid/dockchannel-hid/dockchannel-hid.c:987:18: warning: format specifies type 'long' but the argument has type '__size_t' (aka 'unsigned int') [-Wformat]
     986 |                 dev_err(iface->dchid->dev, "Bad sub header length (%d > %ld)\n",
         |                                                                         ~~~
         |                                                                         %zu
     987 |                         shdr->length, hdr->length - sizeof(*shdr));
         |                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/dev_printk.h:154:65: note: expanded from macro 'dev_err'
     154 |         dev_printk_index_wrap(_dev_err, KERN_ERR, 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 generated.


vim +987 drivers/hid/dockchannel-hid/dockchannel-hid.c

   979	
   980	static void dchid_handle_ack(struct dchid_iface *iface, struct dchid_hdr *hdr, void *data)
   981	{
   982		struct dchid_subhdr *shdr = (void *)data;
   983		u8 *payload = data + sizeof(*shdr);
   984	
   985		if (shdr->length + sizeof(*shdr) > hdr->length) {
   986			dev_err(iface->dchid->dev, "Bad sub header length (%d > %ld)\n",
 > 987				shdr->length, hdr->length - sizeof(*shdr));
   988			return;
   989		}
   990		if (shdr->flags != iface->out_flags) {
   991			dev_err(iface->dchid->dev,
   992				"Received unexpected flags 0x%x on ACK channel (expFected 0x%x)\n",
   993				shdr->flags, iface->out_flags);
   994			return;
   995		}
   996	
   997		if (shdr->length < 1) {
   998			dev_err(iface->dchid->dev, "Received length 0 output report ack\n");
   999			return;
  1000		}
  1001		if (iface->tx_seq != hdr->seq) {
  1002			dev_err(iface->dchid->dev, "Received ACK with bad seq (expected %d, got %d)\n",
  1003				iface->tx_seq, hdr->seq);
  1004			return;
  1005		}
  1006		if (iface->out_report != payload[0]) {
  1007			dev_err(iface->dchid->dev, "Received ACK with bad report (expected %d, got %d\n",
  1008				iface->out_report, payload[0]);
  1009			return;
  1010		}
  1011	
  1012		if (iface->resp_buf && iface->resp_size)
  1013			memcpy(iface->resp_buf, payload + 1, min((size_t)shdr->length - 1, iface->resp_size));
  1014	
  1015		iface->resp_size = shdr->length;
  1016		iface->out_report = -1;
  1017		iface->retcode = shdr->retcode;
  1018		complete(&iface->out_complete);
  1019	}
  1020	

-- 
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:[~2025-08-04 14:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-04 14:53 [asahilinux:bits/090-spi-hid 18/19] drivers/hid/dockchannel-hid/dockchannel-hid.c:987:18: warning: format specifies type 'long' but the argument has type '__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;
as well as URLs for NNTP newsgroup(s).