Thread (7 messages) 7 messages, 4 authors, 2025-06-30

Re: [PATCH] HID: playstation: DS4: Add BT poll interval adjustment

From: Terry Junge <hidden>
Date: 2025-06-30 03:46:23
Also in: lkml, oe-kbuild-all


On 5/13/25 1:44 AM, Vadym Tytan wrote:
quoted
kernel test robot noticed the following build warnings:

sparse warnings: (new ones prefixed by >>)
quoted
quoted
drivers/hid/hid-playstation.c:1773:25: sparse: sparse: symbol 'dev_attr_dualshock4_bt_poll_interval' was not declared. Should it be static?
vim +/dev_attr_dualshock4_bt_poll_interval +1773 drivers/hid/hid-playstation.c

   1772   
quoted
1773    struct device_attribute dev_attr_dualshock4_bt_poll_interval = {
   1774        .attr    = { .name = "bt_poll_interval", .mode = 0644 },
Should it be      .attr    = { .name = "dualshock4_bt_poll_interval", .mode = 0644 },  ?

Or did you not expand the macro fully on purpose?

Thanks,
Terry
quoted
   1775        .show    = dualshock4_show_poll_interval,
   1776        .store    = dualshock4_store_poll_interval,
   1777    };
   1778   
This piece of code is expanded `DEVICE_ATTR` macro with changed variable name.
`DEVICE_ATTR` is defined as:
// Reference: https://github.com/intel-lab-lkp/linux/blob/Vadym-Tytan/HID-playstation-DS4-Add-BT-poll-interval-adjustment/20250509-054413/include/linux/device.h#L138-L158
#define DEVICE_ATTR(_name, _mode, _show, _store) \
    struct device_attribute dev_attr_##_name = __ATTR(_name, _mode, _show, _store)
It doesn't use `static` so neither did I.

P.S. Macro was expanded and variable name was changed from `dev_attr_bt_poll_interval` to `dev_attr_dualshock4_bt_poll_interval` because this attribute only applies to DualShock4
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help