2024-01-19 07:28:02

by Jiapeng Chong

[permalink] [raw]
Subject: [PATCH] HID: nintendo: Remove some unused functions

These functions are defined in the hid-nintendo.c file, but not called
elsewhere, so delete these unused functions.

drivers/hid/hid-nintendo.c:670:20: warning: unused function 'joycon_device_is_left_joycon'.
drivers/hid/hid-nintendo.c:674:20: warning: unused function 'joycon_device_is_right_joycon'

Reported-by: Abaci Robot <[email protected]>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=7992
Signed-off-by: Jiapeng Chong <[email protected]>
---
drivers/hid/hid-nintendo.c | 10 ----------
1 file changed, 10 deletions(-)

diff --git a/drivers/hid/hid-nintendo.c b/drivers/hid/hid-nintendo.c
index ccc4032fb2b0..7ce6be0a8dee 100644
--- a/drivers/hid/hid-nintendo.c
+++ b/drivers/hid/hid-nintendo.c
@@ -667,16 +667,6 @@ struct joycon_ctlr {
* These helpers are most useful early during the HID probe or in conjunction
* with the capability helpers below.
*/
-static inline bool joycon_device_is_left_joycon(struct joycon_ctlr *ctlr)
-{
- return ctlr->hdev->product == USB_DEVICE_ID_NINTENDO_JOYCONL;
-}
-
-static inline bool joycon_device_is_right_joycon(struct joycon_ctlr *ctlr)
-{
- return ctlr->hdev->product == USB_DEVICE_ID_NINTENDO_JOYCONR;
-}
-
static inline bool joycon_device_is_procon(struct joycon_ctlr *ctlr)
{
return ctlr->hdev->product == USB_DEVICE_ID_NINTENDO_PROCON;
--
2.20.1.7.g153144c



2024-01-19 20:13:02

by Silvan Jegen

[permalink] [raw]
Subject: Re: [PATCH] HID: nintendo: Remove some unused functions

Jiapeng Chong <[email protected]> wrote:
> These functions are defined in the hid-nintendo.c file, but not called
> elsewhere, so delete these unused functions.
>
> drivers/hid/hid-nintendo.c:670:20: warning: unused function 'joycon_device_is_left_joycon'.
> drivers/hid/hid-nintendo.c:674:20: warning: unused function 'joycon_device_is_right_joycon'
>
> Reported-by: Abaci Robot <[email protected]>
> Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=7992
> Signed-off-by: Jiapeng Chong <[email protected]>
> ---
> drivers/hid/hid-nintendo.c | 10 ----------
> 1 file changed, 10 deletions(-)

Reviewed-by: Silvan Jegen <[email protected]>


>
> diff --git a/drivers/hid/hid-nintendo.c b/drivers/hid/hid-nintendo.c
> index ccc4032fb2b0..7ce6be0a8dee 100644
> --- a/drivers/hid/hid-nintendo.c
> +++ b/drivers/hid/hid-nintendo.c
> @@ -667,16 +667,6 @@ struct joycon_ctlr {
> * These helpers are most useful early during the HID probe or in conjunction
> * with the capability helpers below.
> */
> -static inline bool joycon_device_is_left_joycon(struct joycon_ctlr *ctlr)
> -{
> - return ctlr->hdev->product == USB_DEVICE_ID_NINTENDO_JOYCONL;
> -}
> -
> -static inline bool joycon_device_is_right_joycon(struct joycon_ctlr *ctlr)
> -{
> - return ctlr->hdev->product == USB_DEVICE_ID_NINTENDO_JOYCONR;
> -}
> -
> static inline bool joycon_device_is_procon(struct joycon_ctlr *ctlr)
> {
> return ctlr->hdev->product == USB_DEVICE_ID_NINTENDO_PROCON;



2024-01-23 10:20:13

by Jiri Kosina

[permalink] [raw]
Subject: Re: [PATCH] HID: nintendo: Remove some unused functions

On Fri, 19 Jan 2024, Jiapeng Chong wrote:

> These functions are defined in the hid-nintendo.c file, but not called
> elsewhere, so delete these unused functions.
>
> drivers/hid/hid-nintendo.c:670:20: warning: unused function 'joycon_device_is_left_joycon'.
> drivers/hid/hid-nintendo.c:674:20: warning: unused function 'joycon_device_is_right_joycon'
>
> Reported-by: Abaci Robot <[email protected]>
> Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=7992
> Signed-off-by: Jiapeng Chong <[email protected]>

Applied, thanks.

--
Jiri Kosina
SUSE Labs