[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <202511201651.tkKTEKpn-lkp@intel.com>
Date: Thu, 20 Nov 2025 16:40:44 +0800
From: kernel test robot <lkp@...el.com>
To: Lucas Zampieri <lzampier@...hat.com>, linux-input@...r.kernel.org
Cc: llvm@...ts.linux.dev, oe-kbuild-all@...ts.linux.dev,
Lucas Zampieri <lzampier@...hat.com>, linux-kernel@...r.kernel.org,
Jiri Kosina <jikos@...nel.org>,
Benjamin Tissoires <bentiss@...nel.org>,
Sebastian Reichel <sre@...nel.org>,
Bastien Nocera <hadess@...ess.net>, linux-pm@...r.kernel.org
Subject: Re: [PATCH v3 1/1] HID: input: Add support for multiple batteries
per device
Hi Lucas,
kernel test robot noticed the following build errors:
[auto build test ERROR on hid/for-next]
[also build test ERROR on dtor-input/for-linus linus/master v6.18-rc6 next-20251119]
[cannot apply to dtor-input/next]
[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/Lucas-Zampieri/HID-input-Add-support-for-multiple-batteries-per-device/20251119-223834
base: https://git.kernel.org/pub/scm/linux/kernel/git/hid/hid.git for-next
patch link: https://lore.kernel.org/r/20251119143005.1513531-2-lzampier%40redhat.com
patch subject: [PATCH v3 1/1] HID: input: Add support for multiple batteries per device
config: um-defconfig (https://download.01.org/0day-ci/archive/20251120/202511201651.tkKTEKpn-lkp@intel.com/config)
compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project 9e9fe08b16ea2c4d9867fb4974edf2a3776d6ece)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251120/202511201651.tkKTEKpn-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@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202511201651.tkKTEKpn-lkp@intel.com/
All errors (new ones prefixed by >>):
>> drivers/hid/hid-input.c:1550:4: error: call to undeclared function 'hidinput_update_battery'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
1550 | hidinput_update_battery(bat, usage->hid, value);
| ^
1 error generated.
vim +/hidinput_update_battery +1550 drivers/hid/hid-input.c
1536
1537 void hidinput_hid_event(struct hid_device *hid, struct hid_field *field, struct hid_usage *usage, __s32 value)
1538 {
1539 struct input_dev *input;
1540 struct hid_report *report = field->report;
1541 unsigned *quirks = &hid->quirks;
1542
1543 if (!usage->type)
1544 return;
1545
1546 if (usage->type == EV_PWR) {
1547 struct hid_battery *bat = hidinput_find_battery(hid, report->id);
1548
1549 if (bat)
> 1550 hidinput_update_battery(bat, usage->hid, value);
1551 return;
1552 }
1553
1554 if (!field->hidinput)
1555 return;
1556
1557 input = field->hidinput->input;
1558
1559 if (usage->hat_min < usage->hat_max || usage->hat_dir) {
1560 int hat_dir = usage->hat_dir;
1561 if (!hat_dir)
1562 hat_dir = (value - usage->hat_min) * 8 / (usage->hat_max - usage->hat_min + 1) + 1;
1563 if (hat_dir < 0 || hat_dir > 8) hat_dir = 0;
1564 input_event(input, usage->type, usage->code , hid_hat_to_axis[hat_dir].x);
1565 input_event(input, usage->type, usage->code + 1, hid_hat_to_axis[hat_dir].y);
1566 return;
1567 }
1568
1569 /*
1570 * Ignore out-of-range values as per HID specification,
1571 * section 5.10 and 6.2.25, when NULL state bit is present.
1572 * When it's not, clamp the value to match Microsoft's input
1573 * driver as mentioned in "Required HID usages for digitizers":
1574 * https://msdn.microsoft.com/en-us/library/windows/hardware/dn672278(v=vs.85).asp
1575 *
1576 * The logical_minimum < logical_maximum check is done so that we
1577 * don't unintentionally discard values sent by devices which
1578 * don't specify logical min and max.
1579 */
1580 if ((field->flags & HID_MAIN_ITEM_VARIABLE) &&
1581 field->logical_minimum < field->logical_maximum) {
1582 if (field->flags & HID_MAIN_ITEM_NULL_STATE &&
1583 (value < field->logical_minimum ||
1584 value > field->logical_maximum)) {
1585 dbg_hid("Ignoring out-of-range value %x\n", value);
1586 return;
1587 }
1588 value = clamp(value,
1589 field->logical_minimum,
1590 field->logical_maximum);
1591 }
1592
1593 switch (usage->hid) {
1594 case HID_DG_ERASER:
1595 report->tool_active |= !!value;
1596
1597 /*
1598 * if eraser is set, we must enforce BTN_TOOL_RUBBER
1599 * to accommodate for devices not following the spec.
1600 */
1601 if (value)
1602 hid_report_set_tool(report, input, BTN_TOOL_RUBBER);
1603 else if (report->tool != BTN_TOOL_RUBBER)
1604 /* value is off, tool is not rubber, ignore */
1605 return;
1606 else if (*quirks & HID_QUIRK_NOINVERT &&
1607 !test_bit(BTN_TOUCH, input->key)) {
1608 /*
1609 * There is no invert to release the tool, let hid_input
1610 * send BTN_TOUCH with scancode and release the tool after.
1611 */
1612 hid_report_release_tool(report, input, BTN_TOOL_RUBBER);
1613 return;
1614 }
1615
1616 /* let hid-input set BTN_TOUCH */
1617 break;
1618
1619 case HID_DG_INVERT:
1620 report->tool_active |= !!value;
1621
1622 /*
1623 * If invert is set, we store BTN_TOOL_RUBBER.
1624 */
1625 if (value)
1626 hid_report_set_tool(report, input, BTN_TOOL_RUBBER);
1627 else if (!report->tool_active)
1628 /* tool_active not set means Invert and Eraser are not set */
1629 hid_report_release_tool(report, input, BTN_TOOL_RUBBER);
1630
1631 /* no further processing */
1632 return;
1633
1634 case HID_DG_INRANGE:
1635 report->tool_active |= !!value;
1636
1637 if (report->tool_active) {
1638 /*
1639 * if tool is not set but is marked as active,
1640 * assume ours
1641 */
1642 if (!report->tool)
1643 report->tool = usage->code;
1644
1645 /* drivers may have changed the value behind our back, resend it */
1646 hid_report_set_tool(report, input, report->tool);
1647 } else {
1648 hid_report_release_tool(report, input, usage->code);
1649 }
1650
1651 /* reset tool_active for the next event */
1652 report->tool_active = false;
1653
1654 /* no further processing */
1655 return;
1656
1657 case HID_DG_TIPSWITCH:
1658 report->tool_active |= !!value;
1659
1660 /* if tool is set to RUBBER we should ignore the current value */
1661 if (report->tool == BTN_TOOL_RUBBER)
1662 return;
1663
1664 break;
1665
1666 case HID_DG_TIPPRESSURE:
1667 if (*quirks & HID_QUIRK_NOTOUCH) {
1668 int a = field->logical_minimum;
1669 int b = field->logical_maximum;
1670
1671 if (value > a + ((b - a) >> 3)) {
1672 input_event(input, EV_KEY, BTN_TOUCH, 1);
1673 report->tool_active = true;
1674 }
1675 }
1676 break;
1677
1678 case HID_UP_PID | 0x83UL: /* Simultaneous Effects Max */
1679 dbg_hid("Maximum Effects - %d\n",value);
1680 return;
1681
1682 case HID_UP_PID | 0x7fUL:
1683 dbg_hid("PID Pool Report\n");
1684 return;
1685 }
1686
1687 switch (usage->type) {
1688 case EV_KEY:
1689 if (usage->code == 0) /* Key 0 is "unassigned", not KEY_UNKNOWN */
1690 return;
1691 break;
1692
1693 case EV_REL:
1694 if (usage->code == REL_WHEEL_HI_RES ||
1695 usage->code == REL_HWHEEL_HI_RES) {
1696 hidinput_handle_scroll(usage, input, value);
1697 return;
1698 }
1699 break;
1700
1701 case EV_ABS:
1702 if ((field->flags & HID_MAIN_ITEM_RELATIVE) &&
1703 usage->code == ABS_VOLUME) {
1704 int count = abs(value);
1705 int direction = value > 0 ? KEY_VOLUMEUP : KEY_VOLUMEDOWN;
1706 int i;
1707
1708 for (i = 0; i < count; i++) {
1709 input_event(input, EV_KEY, direction, 1);
1710 input_sync(input);
1711 input_event(input, EV_KEY, direction, 0);
1712 input_sync(input);
1713 }
1714 return;
1715
1716 } else if (((*quirks & HID_QUIRK_X_INVERT) && usage->code == ABS_X) ||
1717 ((*quirks & HID_QUIRK_Y_INVERT) && usage->code == ABS_Y))
1718 value = field->logical_maximum - value;
1719 break;
1720 }
1721
1722 /*
1723 * Ignore reports for absolute data if the data didn't change. This is
1724 * not only an optimization but also fixes 'dead' key reports. Some
1725 * RollOver implementations for localized keys (like BACKSLASH/PIPE; HID
1726 * 0x31 and 0x32) report multiple keys, even though a localized keyboard
1727 * can only have one of them physically available. The 'dead' keys
1728 * report constant 0. As all map to the same keycode, they'd confuse
1729 * the input layer. If we filter the 'dead' keys on the HID level, we
1730 * skip the keycode translation and only forward real events.
1731 */
1732 if (!(field->flags & (HID_MAIN_ITEM_RELATIVE |
1733 HID_MAIN_ITEM_BUFFERED_BYTE)) &&
1734 (field->flags & HID_MAIN_ITEM_VARIABLE) &&
1735 usage->usage_index < field->maxusage &&
1736 value == field->value[usage->usage_index])
1737 return;
1738
1739 /* report the usage code as scancode if the key status has changed */
1740 if (usage->type == EV_KEY &&
1741 (!test_bit(usage->code, input->key)) == value)
1742 input_event(input, EV_MSC, MSC_SCAN, usage->hid);
1743
1744 input_event(input, usage->type, usage->code, value);
1745
1746 if ((field->flags & HID_MAIN_ITEM_RELATIVE) &&
1747 usage->type == EV_KEY && value) {
1748 input_sync(input);
1749 input_event(input, usage->type, usage->code, 0);
1750 }
1751 }
1752
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Powered by blists - more mailing lists