[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <f5594328-11e4-4310-b961-41d8ca0c8116@gmail.com>
Date: Tue, 13 May 2025 10:44:43 +0200
From: Vadym Tytan <titanv3585@...il.com>
To: 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
> 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 },
> 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