lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202210180519.POeme2q3-lkp@intel.com>
Date:   Tue, 18 Oct 2022 05:44:14 +0800
From:   kernel test robot <lkp@...el.com>
To:     Hector Martin <marcan@...can.st>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org
Subject: [asahilinux:bits/090-spi-hid 29/34]
 drivers/hid/dockchannel-hid/dockchannel-hid.c:569:37: warning: format '%ld'
 expects argument of type 'long int', but argument 3 has type 'size_t' {aka
 'unsigned int'}

tree:   https://github.com/AsahiLinux/linux bits/090-spi-hid
head:   bd3ea9c827680dbc49e10be104d6bb78b0f5527c
commit: c667618792a48a30a217d3d27d16d5805ed8fa8f [29/34] hid: Add Apple DockChannel HID transport driver
config: m68k-allmodconfig
compiler: m68k-linux-gcc (GCC) 12.1.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/AsahiLinux/linux/commit/c667618792a48a30a217d3d27d16d5805ed8fa8f
        git remote add asahilinux https://github.com/AsahiLinux/linux
        git fetch --no-tags asahilinux bits/090-spi-hid
        git checkout c667618792a48a30a217d3d27d16d5805ed8fa8f
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=m68k SHELL=/bin/bash drivers/hid/dockchannel-hid/ drivers/platform/ sound/soc/codecs/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>

All warnings (new ones prefixed by >>):

   drivers/hid/dockchannel-hid/dockchannel-hid.c: In function 'dchid_cmd':
   drivers/hid/dockchannel-hid/dockchannel-hid.c:303:28: error: implicit declaration of function 'FIELD_PREP' [-Werror=implicit-function-declaration]
     303 |         iface->out_flags = FIELD_PREP(FLAGS_GROUP, type) | FIELD_PREP(FLAGS_REQ, req);
         |                            ^~~~~~~~~~
   In file included from include/linux/device.h:15,
                    from drivers/hid/dockchannel-hid/dockchannel-hid.c:10:
   drivers/hid/dockchannel-hid/dockchannel-hid.c: In function 'dchid_handle_ready':
>> drivers/hid/dockchannel-hid/dockchannel-hid.c:569:37: warning: format '%ld' expects argument of type 'long int', but argument 3 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
     569 |                 dev_err(dchid->dev, "Bad length for ready message: %ld\n", length);
         |                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/dev_printk.h:110:30: note: in definition of macro 'dev_printk_index_wrap'
     110 |                 _p_func(dev, fmt, ##__VA_ARGS__);                       \
         |                              ^~~
   include/linux/dev_printk.h:144:56: note: in expansion of macro 'dev_fmt'
     144 |         dev_printk_index_wrap(_dev_err, KERN_ERR, dev, dev_fmt(fmt), ##__VA_ARGS__)
         |                                                        ^~~~~~~
   drivers/hid/dockchannel-hid/dockchannel-hid.c:569:17: note: in expansion of macro 'dev_err'
     569 |                 dev_err(dchid->dev, "Bad length for ready message: %ld\n", length);
         |                 ^~~~~~~
   drivers/hid/dockchannel-hid/dockchannel-hid.c:569:70: note: format string is defined here
     569 |                 dev_err(dchid->dev, "Bad length for ready message: %ld\n", length);
         |                                                                    ~~^
         |                                                                      |
         |                                                                      long int
         |                                                                    %d
   drivers/hid/dockchannel-hid/dockchannel-hid.c: In function 'dchid_packet_work':
   drivers/hid/dockchannel-hid/dockchannel-hid.c:825:20: error: implicit declaration of function 'FIELD_GET'; did you mean 'FOLL_GET'? [-Werror=implicit-function-declaration]
     825 |         int type = FIELD_GET(FLAGS_GROUP, shdr->flags);
         |                    ^~~~~~~~~
         |                    FOLL_GET
>> drivers/hid/dockchannel-hid/dockchannel-hid.c:829:37: warning: format '%ld' expects argument of type 'long int', but argument 4 has type 'unsigned int' [-Wformat=]
     829 |                 dev_err(dchid->dev, "Bad sub header length (%d > %ld)\n",
         |                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/dev_printk.h:110:30: note: in definition of macro 'dev_printk_index_wrap'
     110 |                 _p_func(dev, fmt, ##__VA_ARGS__);                       \
         |                              ^~~
   include/linux/dev_printk.h:144:56: note: in expansion of macro 'dev_fmt'
     144 |         dev_printk_index_wrap(_dev_err, KERN_ERR, dev, dev_fmt(fmt), ##__VA_ARGS__)
         |                                                        ^~~~~~~
   drivers/hid/dockchannel-hid/dockchannel-hid.c:829:17: note: in expansion of macro 'dev_err'
     829 |                 dev_err(dchid->dev, "Bad sub header length (%d > %ld)\n",
         |                 ^~~~~~~
   drivers/hid/dockchannel-hid/dockchannel-hid.c:829:68: note: format string is defined here
     829 |                 dev_err(dchid->dev, "Bad sub header length (%d > %ld)\n",
         |                                                                  ~~^
         |                                                                    |
         |                                                                    long int
         |                                                                  %d
   drivers/hid/dockchannel-hid/dockchannel-hid.c: In function 'dchid_handle_ack':
   drivers/hid/dockchannel-hid/dockchannel-hid.c:855:44: warning: format '%ld' expects argument of type 'long int', but argument 4 has type 'unsigned int' [-Wformat=]
     855 |                 dev_err(iface->dchid->dev, "Bad sub header length (%d > %ld)\n",
         |                                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/dev_printk.h:110:30: note: in definition of macro 'dev_printk_index_wrap'
     110 |                 _p_func(dev, fmt, ##__VA_ARGS__);                       \
         |                              ^~~
   include/linux/dev_printk.h:144:56: note: in expansion of macro 'dev_fmt'
     144 |         dev_printk_index_wrap(_dev_err, KERN_ERR, dev, dev_fmt(fmt), ##__VA_ARGS__)
         |                                                        ^~~~~~~
   drivers/hid/dockchannel-hid/dockchannel-hid.c:855:17: note: in expansion of macro 'dev_err'
     855 |                 dev_err(iface->dchid->dev, "Bad sub header length (%d > %ld)\n",
         |                 ^~~~~~~
   drivers/hid/dockchannel-hid/dockchannel-hid.c:855:75: note: format string is defined here
     855 |                 dev_err(iface->dchid->dev, "Bad sub header length (%d > %ld)\n",
         |                                                                         ~~^
         |                                                                           |
         |                                                                           long int
         |                                                                         %d
   cc1: some warnings being treated as errors


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

   558	
   559	static void dchid_handle_ready(struct dockchannel_hid *dchid, void *data, size_t length)
   560	{
   561		struct hid_device *hid;
   562		struct dchid_iface *iface;
   563		int ret;
   564		u8 *pkt = data;
   565		u8 index;
   566		int i;
   567	
   568		if (length < 2) {
 > 569			dev_err(dchid->dev, "Bad length for ready message: %ld\n", length);
   570			return;
   571		}
   572	
   573		index = pkt[1];
   574	
   575		if (index >= MAX_INTERFACES) {
   576			dev_err(dchid->dev, "Got ready notification for bad iface %d\n", index);
   577			return;
   578		}
   579	
   580		iface = dchid->ifaces[index];
   581		if (!iface) {
   582			dev_err(dchid->dev, "Got ready notification for unknown iface %d\n", index);
   583			return;
   584		}
   585	
   586		if (iface->hid) {
   587			dev_warn(iface->dchid->dev, "Interface %s already ready!\n",
   588				 iface->name);
   589			return;
   590		}
   591	
   592		/* When STM is ready, grab global device info */
   593		if (!strcmp(iface->name, "stm")) {
   594			ret = dchid_get_report_cmd(iface, STM_REPORT_ID, &dchid->device_id,
   595						   sizeof(dchid->device_id));
   596			if (ret < sizeof(dchid->device_id)) {
   597				dev_warn(iface->dchid->dev, "Failed to get device ID from STM!\n");
   598				/* Fake it and keep going. Things might still work... */
   599				memset(&dchid->device_id, 0, sizeof(dchid->device_id));
   600				dchid->device_id.vendor_id = HOST_VENDOR_ID_APPLE;
   601			}
   602			ret = dchid_get_report_cmd(iface, STM_REPORT_SERIAL, dchid->serial,
   603						   sizeof(dchid->serial) - 1);
   604			if (ret < 0) {
   605				dev_warn(iface->dchid->dev, "Failed to get serial from STM!\n");
   606				dchid->serial[0] = 0;
   607			}
   608	
   609			dchid->id_ready = true;
   610			for (i = 0; i < MAX_INTERFACES; i++)
   611				if (dchid->ifaces[i] && dchid->ifaces[i]->deferred)
   612					dchid_init_interface(dchid->ifaces[i]);
   613	
   614		}
   615	
   616		hid = hid_allocate_device();
   617		if (IS_ERR(hid))
   618			return;
   619	
   620		snprintf(hid->name, sizeof(hid->name), "Apple MTP %s", iface->name);
   621		snprintf(hid->phys, sizeof(hid->phys), "%s.%d (%s)",
   622			 dev_name(iface->dchid->dev), iface->index, iface->name);
   623		strscpy(hid->uniq, dchid->serial, sizeof(hid->uniq));
   624	
   625		hid->ll_driver = &dchid_ll;
   626		hid->bus = BUS_HOST;
   627		hid->vendor = dchid->device_id.vendor_id;
   628		hid->product = dchid->device_id.product_id;
   629		hid->version = dchid->device_id.version_number;
   630		hid->type = HID_TYPE_OTHER;
   631		if (!strcmp(iface->name, "multi-touch")) {
   632			hid->type = HID_TYPE_SPI_MOUSE;
   633		} else if (!strcmp(iface->name, "keyboard")) {
   634			hid->type = HID_TYPE_SPI_KEYBOARD;
   635	
   636			/* These country codes match what earlier Apple HID keyboards did */
   637			switch (dchid->device_id.keyboard_type) {
   638			case KEYBOARD_TYPE_ANSI:
   639				hid->country = 33; // US-English
   640				break;
   641	
   642			case KEYBOARD_TYPE_ISO:
   643				hid->country = 13; // ISO
   644				break;
   645	
   646			case KEYBOARD_TYPE_JIS:
   647				hid->country = 15; // Japan
   648				break;
   649			}
   650		}
   651	
   652		hid->dev.parent = iface->dchid->dev;
   653		hid->driver_data = iface;
   654	
   655		ret = hid_add_device(hid);
   656		if (ret < 0) {
   657			hid_destroy_device(hid);
   658			dev_warn(iface->dchid->dev, "Failed to register hid device %s", iface->name);
   659			return;
   660		}
   661	
   662		iface->hid = hid;
   663	}
   664	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

View attachment "config" of type "text/plain" (276770 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ