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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202212261936.1X4WuXgb-lkp@intel.com>
Date:   Mon, 26 Dec 2022 19:22:00 +0800
From:   kernel test robot <lkp@...el.com>
To:     Joshua Goins <josh@...strate.com>, linux-input@...r.kernel.org
Cc:     oe-kbuild-all@...ts.linux.dev, jikos@...nel.org,
        benjamin.tissoires@...hat.com, kurikaesu@...rs.noreply.github.com,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] HID: uclogic: Add support for XP-PEN Artist 22R Pro

Hi Joshua,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on hid/for-next]
[also build test WARNING on linus/master v6.2-rc1 next-20221226]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Joshua-Goins/HID-uclogic-Add-support-for-XP-PEN-Artist-22R-Pro/20221226-112302
base:   https://git.kernel.org/pub/scm/linux/kernel/git/hid/hid.git for-next
patch link:    https://lore.kernel.org/r/2068502.VLH7GnMWUR%40adrastea
patch subject: [PATCH] HID: uclogic: Add support for XP-PEN Artist 22R Pro
config: arc-randconfig-r003-20221226
compiler: arc-elf-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/intel-lab-lkp/linux/commit/51d8c9b14fc55dcb5b8e3f7f4e0cc582ce9097d7
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Joshua-Goins/HID-uclogic-Add-support-for-XP-PEN-Artist-22R-Pro/20221226-112302
        git checkout 51d8c9b14fc55dcb5b8e3f7f4e0cc582ce9097d7
        # 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=arc olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arc SHELL=/bin/bash drivers/hid/

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 >>):

   In file included from include/linux/device.h:15,
                    from include/linux/usb.h:19,
                    from drivers/hid/hid-uclogic-params.h:19,
                    from drivers/hid/hid-uclogic-params.c:16:
   drivers/hid/hid-uclogic-params.c: In function 'uclogic_params_init_ugee_xppen_pro':
>> drivers/hid/hid-uclogic-params.c:1487:33: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t' {aka 'unsigned int'} [-Wformat=]
    1487 |                                 "string descriptor with pen parameters has invalid length (got %d, expected %lu)\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__)
         |                                                        ^~~~~~~
   include/linux/hid.h:1206:9: note: in expansion of macro 'dev_err'
    1206 |         dev_err(&(hid)->dev, fmt, ##__VA_ARGS__)
         |         ^~~~~~~
   drivers/hid/hid-uclogic-params.c:1486:25: note: in expansion of macro 'hid_err'
    1486 |                         hid_err(hdev,
         |                         ^~~~~~~
   drivers/hid/hid-uclogic-params.c:1487:111: note: format string is defined here
    1487 |                                 "string descriptor with pen parameters has invalid length (got %d, expected %lu)\n",
         |                                                                                                             ~~^
         |                                                                                                               |
         |                                                                                                               long unsigned int
         |                                                                                                             %u


vim +1487 drivers/hid/hid-uclogic-params.c

  1422	
  1423	
  1424	/*
  1425	 * uclogic_params_init_ugee_xppen_pro() - Initializes a UGEE XP-Pen Pro tablet device.
  1426	 *
  1427	 * @hdev:	The HID device of the tablet interface to initialize and get
  1428	 *		parameters from. Cannot be NULL.
  1429	 * @params:	Parameters to fill in (to be cleaned with
  1430	 *		uclogic_params_cleanup()). Not modified in case of error.
  1431	 *		Cannot be NULL.
  1432	 *
  1433	 * Returns:
  1434	 *	Zero, if successful. A negative errno code on error.
  1435	 */
  1436	static int uclogic_params_init_ugee_xppen_pro(struct hid_device *hdev,
  1437						      struct uclogic_params *p,
  1438						      const u8 probe_endpoint,
  1439						      const u8 rdesc_init_packet[],
  1440						      const size_t rdesc_init_size,
  1441						      const u8 rdesc_tablet_arr[],
  1442						      const size_t rdesc_tablet_size,
  1443						      const u8 rdesc_frame_arr[],
  1444						      const size_t rdesc_frame_size)
  1445	{
  1446		const size_t str_desc_len = 12;
  1447		struct usb_device *udev = hid_to_usb_dev(hdev);
  1448		u8 *buf = kmemdup(rdesc_init_packet, rdesc_init_size, GFP_KERNEL);
  1449		s32 desc_params[UCLOGIC_RDESC_PH_ID_NUM];
  1450		int actual_len, rc;
  1451		u16 resolution;
  1452	
  1453		if (hdev == NULL || p == NULL)
  1454			return -EINVAL;
  1455	
  1456		rc = usb_interrupt_msg(
  1457			udev,
  1458			usb_sndintpipe(udev, probe_endpoint),
  1459			buf,
  1460			rdesc_init_size,
  1461			&actual_len,
  1462			USB_CTRL_SET_TIMEOUT);
  1463		kfree(buf);
  1464		if (rc == -EPIPE) {
  1465			hid_err(hdev, "broken pipe sending init packet\n");
  1466			return rc;
  1467		} else if (rc < 0) {
  1468			hid_err(hdev, "failed sending init packet: %d\n", rc);
  1469			return rc;
  1470		} else if (actual_len != rdesc_init_size) {
  1471			hid_err(hdev,
  1472				"failed to transfer complete init packet, only %d bytes sent\n",
  1473				actual_len);
  1474			return -1;
  1475		}
  1476	
  1477		rc = uclogic_params_get_str_desc(&buf, hdev, 100, str_desc_len);
  1478		if (rc != str_desc_len) {
  1479			if (rc == -EPIPE) {
  1480				hid_err(hdev,
  1481					"string descriptor with pen parameters not found\n");
  1482			} else if (rc < 0) {
  1483				hid_err(hdev,
  1484					"failed retrieving pen parameters: %d\n", rc);
  1485			} else {
  1486				hid_err(hdev,
> 1487					"string descriptor with pen parameters has invalid length (got %d, expected %lu)\n",
  1488					rc,
  1489					str_desc_len);
  1490				rc = -1;
  1491			}
  1492			kfree(buf);
  1493			return rc;
  1494		}
  1495	
  1496		desc_params[UCLOGIC_RDESC_PEN_PH_ID_X_LM] = get_unaligned_le16(buf + 2);
  1497		desc_params[UCLOGIC_RDESC_PEN_PH_ID_Y_LM] = get_unaligned_le16(buf + 4);
  1498		/* buf + 6 is the number of pad buttons? Its 0x0008 */
  1499		desc_params[UCLOGIC_RDESC_PEN_PH_ID_PRESSURE_LM] =
  1500			get_unaligned_le16(buf + 8);
  1501		resolution = get_unaligned_le16(buf + 10);
  1502		kfree(buf);
  1503		if (resolution == 0) {
  1504			hid_err(hdev, "resolution of 0 in descriptor string\n");
  1505			return -1;
  1506		}
  1507		desc_params[UCLOGIC_RDESC_PEN_PH_ID_X_PM] =
  1508			desc_params[UCLOGIC_RDESC_PEN_PH_ID_X_LM] * 1000 / resolution;
  1509		desc_params[UCLOGIC_RDESC_PEN_PH_ID_Y_PM] =
  1510			desc_params[UCLOGIC_RDESC_PEN_PH_ID_Y_LM] * 1000 / resolution;
  1511	
  1512		hid_dbg(hdev,
  1513			"Received parameters: X: %d Y: %d Pressure: %d Resolution: %u\n",
  1514			desc_params[UCLOGIC_RDESC_PEN_PH_ID_X_LM],
  1515			desc_params[UCLOGIC_RDESC_PEN_PH_ID_Y_LM],
  1516			desc_params[UCLOGIC_RDESC_PEN_PH_ID_PRESSURE_LM],
  1517			resolution);
  1518	
  1519		p->pen.desc_ptr = uclogic_rdesc_template_apply(
  1520			rdesc_tablet_arr,
  1521			rdesc_tablet_size,
  1522			desc_params,
  1523			ARRAY_SIZE(desc_params));
  1524		p->pen.desc_size = rdesc_tablet_size;
  1525		p->pen.id = 0x02;
  1526	
  1527		rc = uclogic_params_frame_init_with_desc(
  1528			&p->frame_list[0],
  1529			rdesc_frame_arr,
  1530			rdesc_frame_size,
  1531			UCLOGIC_RDESC_V1_FRAME_ID);
  1532		if (rc < 0) {
  1533			hid_err(hdev, "initializing frame params failed: %d\n", rc);
  1534			return rc;
  1535		}
  1536	
  1537		p->pen.subreport_list[0].value = 0xf0;
  1538		p->pen.subreport_list[0].id = p->frame_list[0].id;
  1539	
  1540		return 0;
  1541	}
  1542	

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

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ