[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <cce2d94e-8798-489f-8c9f-68f021bb21a7@cosmicgizmosystems.com>
Date: Sun, 29 Jun 2025 20:41:04 -0700
From: Terry Junge <linuxhid@...micgizmosystems.com>
To: Vadym Tytan <titanv3585@...il.com>, kernel test robot <lkp@...el.com>,
Roderick Colenbrander <roderick.colenbrander@...y.com>,
Jiri Kosina <jikos@...nel.org>, Benjamin Tissoires <bentiss@...nel.org>,
linux-kernel@...r.kernel.org, linux-input@...r.kernel.org
Cc: oe-kbuild-all@...ts.linux.dev
Subject: Re: [PATCH] HID: playstation: DS4: Add BT poll interval adjustment
On 5/13/25 1:44 AM, Vadym Tytan wrote:
>> kernel test robot noticed the following build warnings:
>>
>> sparse warnings: (new ones prefixed by >>)
>>>> 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
>>> 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
>> 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:
> ```c
> // 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
>
>
Powered by blists - more mailing lists