[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202301030629.RdUCaHhF-lkp@intel.com>
Date: Tue, 3 Jan 2023 06:46:36 +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, jose.exposito89@...il.com,
Joshua Goins <josh@...strate.com>,
kernel test robot <lkp@...el.com>,
Dan Carpenter <error27@...il.com>,
Jiri Kosina <jikos@...nel.org>,
Benjamin Tissoires <benjamin.tissoires@...hat.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] 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 88603b6dc419445847923fcb7fe5080067a30f98]
url: https://github.com/intel-lab-lkp/linux/commits/Joshua-Goins/HID-uclogic-Add-support-for-XP-PEN-Artist-22R-Pro/20230103-035221
base: 88603b6dc419445847923fcb7fe5080067a30f98
patch link: https://lore.kernel.org/r/20230102194911.56083-1-josh%40redstrate.com
patch subject: [PATCH v2] HID: uclogic: Add support for XP-PEN Artist 22R Pro
config: m68k-allyesconfig
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/intel-lab-lkp/linux/commit/544bdd996d164d0202d03318e29f3ec570f88b16
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/20230103-035221
git checkout 544bdd996d164d0202d03318e29f3ec570f88b16
# 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 olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=m68k SHELL=/bin/bash drivers/
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: In function 'uclogic_params_init_ugee_xppen_pro':
>> drivers/hid/hid-uclogic-params.c:1522:38: warning: passing argument 2 of 'uclogic_probe_interface' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
1522 | uclogic_ugee_v2_probe_arr,
| ^~~~~~~~~~~~~~~~~~~~~~~~~
drivers/hid/hid-uclogic-params.c:1026:65: note: expected 'u8 *' {aka 'unsigned char *'} but argument is of type 'const __u8 *' {aka 'const unsigned char *'}
1026 | static int uclogic_probe_interface(struct hid_device *hdev, u8 *magic_arr,
| ~~~~^~~~~~~~~
vim +1522 drivers/hid/hid-uclogic-params.c
1475
1476 /*
1477 * uclogic_params_init_ugee_xppen_pro() - Initializes a UGEE XP-Pen Pro tablet device.
1478 *
1479 * @hdev: The HID device of the tablet interface to initialize and get
1480 * parameters from. Cannot be NULL.
1481 * @params: Parameters to fill in (to be cleaned with
1482 * uclogic_params_cleanup()). Not modified in case of error.
1483 * Cannot be NULL.
1484 *
1485 * Returns:
1486 * Zero, if successful. A negative errno code on error.
1487 */
1488 static int uclogic_params_init_ugee_xppen_pro(struct uclogic_params *params,
1489 struct hid_device *hdev,
1490 const u8 rdesc_frame_arr[],
1491 const size_t rdesc_frame_size)
1492 {
1493 int rc = 0;
1494 struct usb_interface *iface;
1495 __u8 bInterfaceNumber;
1496 const int str_desc_len = 12;
1497 u8 *str_desc = NULL;
1498 __u8 *rdesc_pen = NULL;
1499 s32 desc_params[UCLOGIC_RDESC_PH_ID_NUM];
1500 /* The resulting parameters (noop) */
1501 struct uclogic_params p = {0, };
1502
1503 if (!hdev || !params) {
1504 rc = -EINVAL;
1505 goto cleanup;
1506 }
1507
1508 iface = to_usb_interface(hdev->dev.parent);
1509 bInterfaceNumber = iface->cur_altsetting->desc.bInterfaceNumber;
1510
1511 /* Ignore non-pen interfaces */
1512 if (bInterfaceNumber != 2) {
1513 uclogic_params_init_invalid(&p);
1514 goto output;
1515 }
1516
1517 /*
1518 * Initialize the interface by sending magic data.
1519 * This magic data is the same as other UGEE v2 tablets.
1520 */
1521 rc = uclogic_probe_interface(hdev,
> 1522 uclogic_ugee_v2_probe_arr,
1523 uclogic_ugee_v2_probe_size,
1524 0x03);
1525 if (rc) {
1526 uclogic_params_init_invalid(&p);
1527 goto output;
1528 }
1529
1530 /**
1531 * Read the string descriptor containing pen and frame parameters.
1532 * These are slightly different than typical UGEE v2 devices.
1533 */
1534 rc = uclogic_params_get_str_desc(&str_desc, hdev, 100, str_desc_len);
1535 if (rc != str_desc_len) {
1536 hid_err(hdev, "failed retrieving pen and frame parameters: %d\n", rc);
1537 uclogic_params_init_invalid(&p);
1538 goto output;
1539 }
1540
1541 rc = uclogic_params_parse_ugee_xppen_pro_desc(str_desc, str_desc_len,
1542 desc_params,
1543 ARRAY_SIZE(desc_params));
1544 if (rc)
1545 goto cleanup;
1546
1547 kfree(str_desc);
1548 str_desc = NULL;
1549
1550 /* Initialize the pen interface */
1551 rdesc_pen = uclogic_rdesc_template_apply(
1552 uclogic_rdesc_ugee_v2_pen_template_arr,
1553 uclogic_rdesc_ugee_v2_pen_template_size,
1554 desc_params, ARRAY_SIZE(desc_params));
1555 if (!rdesc_pen) {
1556 rc = -ENOMEM;
1557 goto cleanup;
1558 }
1559
1560 p.pen.desc_ptr = rdesc_pen;
1561 p.pen.desc_size = uclogic_rdesc_ugee_v2_pen_template_size;
1562 p.pen.id = 0x02;
1563 p.pen.subreport_list[0].value = 0xf0;
1564 p.pen.subreport_list[0].id = UCLOGIC_RDESC_V1_FRAME_ID;
1565
1566 /* Initialize the frame interface */
1567 rc = uclogic_params_frame_init_with_desc(
1568 &p.frame_list[0],
1569 rdesc_frame_arr,
1570 rdesc_frame_size,
1571 UCLOGIC_RDESC_V1_FRAME_ID);
1572 if (rc < 0) {
1573 hid_err(hdev, "initializing frame params failed: %d\n", rc);
1574 goto output;
1575 }
1576
1577 p.frame_list[0].bitmap_dial_byte = 7;
1578 p.frame_list[0].bitmap_second_dial_destination_byte = 8;
1579
1580 output:
1581 /* Output parameters */
1582 memcpy(params, &p, sizeof(*params));
1583 memset(&p, 0, sizeof(p));
1584 rc = 0;
1585 cleanup:
1586 kfree(str_desc);
1587 uclogic_params_cleanup(&p);
1588 return rc;
1589 }
1590
--
0-DAY CI Kernel Test Service
https://01.org/lkp
View attachment "config" of type "text/plain" (284882 bytes)
Powered by blists - more mailing lists