diff mbox series

HID: nintendo: Remove some unused functions

Message ID 20240126075445.15495-1-jiapeng.chong@linux.alibaba.com (mailing list archive)
State Mainlined
Commit 05c7d1de81eb615d994e50bd7fb9c948ea1989e2
Delegated to: Jiri Kosina
Headers show
Series HID: nintendo: Remove some unused functions | expand

Commit Message

Jiapeng Chong Jan. 26, 2024, 7:54 a.m. UTC
These functions are defined in the hid-nintendo.c file, but not called
elsewhere, so delete these unused functions.

drivers/hid/hid-nintendo.c:757:20: warning: unused function 'joycon_type_has_left_controls'.
drivers/hid/hid-nintendo.c:763:20: warning: unused function 'joycon_type_has_right_controls'.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=8060
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
 drivers/hid/hid-nintendo.c | 12 ------------
 1 file changed, 12 deletions(-)

Comments

Jiri Kosina Feb. 13, 2024, 3:25 p.m. UTC | #1
On Fri, 26 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:757:20: warning: unused function 'joycon_type_has_left_controls'.
> drivers/hid/hid-nintendo.c:763:20: warning: unused function 'joycon_type_has_right_controls'.
> 
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=8060
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>

No idea why those were added, CCing Ryan, who added those in 94f18bb1994. 
I've added a Fixes: tag and applied, thanks.

> ---
>  drivers/hid/hid-nintendo.c | 12 ------------
>  1 file changed, 12 deletions(-)
> 
> diff --git a/drivers/hid/hid-nintendo.c b/drivers/hid/hid-nintendo.c
> index 7ce6be0a8dee..ab5953fc2436 100644
> --- a/drivers/hid/hid-nintendo.c
> +++ b/drivers/hid/hid-nintendo.c
> @@ -754,18 +754,6 @@ static inline bool joycon_type_is_right_nescon(struct joycon_ctlr *ctlr)
>  	return ctlr->ctlr_type == JOYCON_CTLR_TYPE_NESR;
>  }
>  
> -static inline bool joycon_type_has_left_controls(struct joycon_ctlr *ctlr)
> -{
> -	return joycon_type_is_left_joycon(ctlr) ||
> -	       joycon_type_is_procon(ctlr);
> -}
> -
> -static inline bool joycon_type_has_right_controls(struct joycon_ctlr *ctlr)
> -{
> -	return joycon_type_is_right_joycon(ctlr) ||
> -	       joycon_type_is_procon(ctlr);
> -}
> -
>  static inline bool joycon_type_is_any_joycon(struct joycon_ctlr *ctlr)
>  {
>  	return joycon_type_is_left_joycon(ctlr) ||
> -- 
> 2.20.1.7.g153144c
>
diff mbox series

Patch

diff --git a/drivers/hid/hid-nintendo.c b/drivers/hid/hid-nintendo.c
index 7ce6be0a8dee..ab5953fc2436 100644
--- a/drivers/hid/hid-nintendo.c
+++ b/drivers/hid/hid-nintendo.c
@@ -754,18 +754,6 @@  static inline bool joycon_type_is_right_nescon(struct joycon_ctlr *ctlr)
 	return ctlr->ctlr_type == JOYCON_CTLR_TYPE_NESR;
 }
 
-static inline bool joycon_type_has_left_controls(struct joycon_ctlr *ctlr)
-{
-	return joycon_type_is_left_joycon(ctlr) ||
-	       joycon_type_is_procon(ctlr);
-}
-
-static inline bool joycon_type_has_right_controls(struct joycon_ctlr *ctlr)
-{
-	return joycon_type_is_right_joycon(ctlr) ||
-	       joycon_type_is_procon(ctlr);
-}
-
 static inline bool joycon_type_is_any_joycon(struct joycon_ctlr *ctlr)
 {
 	return joycon_type_is_left_joycon(ctlr) ||