[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202212261620.TDa6yEnS-lkp@intel.com>
Date: Mon, 26 Dec 2022 16:29:57 +0800
From: kernel test robot <lkp@...el.com>
To: Joshua Goins <josh@...strate.com>, linux-input@...r.kernel.org
Cc: llvm@...ts.linux.dev, 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: arm-randconfig-r021-20221226
compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project f5700e7b69048de958172fb513b336564e7f8709)
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
# install arm cross compiling tool for clang build
# apt-get install binutils-arm-linux-gnueabi
# 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=clang make.cross W=1 O=build_dir ARCH=arm olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm 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 >>):
>> drivers/hid/hid-uclogic-params.c:1489:5: warning: format specifies type 'unsigned long' but the argument has type 'size_t' (aka 'unsigned int') [-Wformat]
str_desc_len);
^~~~~~~~~~~~
include/linux/hid.h:1206:30: note: expanded from macro 'hid_err'
dev_err(&(hid)->dev, fmt, ##__VA_ARGS__)
~~~ ^~~~~~~~~~~
include/linux/dev_printk.h:144:65: note: expanded from macro 'dev_err'
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'
_p_func(dev, fmt, ##__VA_ARGS__); \
~~~ ^~~~~~~~~~~
1 warning generated.
vim +1489 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" (179626 bytes)
Powered by blists - more mailing lists