Linux Input/HID development
 help / color / mirror / Atom feed
* [PATCH] HID: nintendo: Remove some unused functions
@ 2024-01-19  7:27 Jiapeng Chong
  2024-01-19 20:12 ` Silvan Jegen
  2024-01-23 10:20 ` Jiri Kosina
  0 siblings, 2 replies; 7+ messages in thread
From: Jiapeng Chong @ 2024-01-19  7:27 UTC (permalink / raw)
  To: djogorchock
  Cc: jikos, benjamin.tissoires, linux-input, linux-kernel,
	Jiapeng Chong, Abaci Robot

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 <abaci@linux.alibaba.com>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=7992
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
 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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] HID: nintendo: Remove some unused functions
  2024-01-19  7:27 [PATCH] HID: nintendo: Remove some unused functions Jiapeng Chong
@ 2024-01-19 20:12 ` Silvan Jegen
  2024-01-23 10:20 ` Jiri Kosina
  1 sibling, 0 replies; 7+ messages in thread
From: Silvan Jegen @ 2024-01-19 20:12 UTC (permalink / raw)
  To: Jiapeng Chong
  Cc: djogorchock, jikos, benjamin.tissoires, linux-input, linux-kernel,
	Abaci Robot

Jiapeng Chong <jiapeng.chong@linux.alibaba.com> 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 <abaci@linux.alibaba.com>
> Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=7992
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
> ---
>  drivers/hid/hid-nintendo.c | 10 ----------
>  1 file changed, 10 deletions(-)

Reviewed-by: Silvan Jegen <s.jegen@gmail.com>


> 
> 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;



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] HID: nintendo: Remove some unused functions
  2024-01-19  7:27 [PATCH] HID: nintendo: Remove some unused functions Jiapeng Chong
  2024-01-19 20:12 ` Silvan Jegen
@ 2024-01-23 10:20 ` Jiri Kosina
  1 sibling, 0 replies; 7+ messages in thread
From: Jiri Kosina @ 2024-01-23 10:20 UTC (permalink / raw)
  To: Jiapeng Chong
  Cc: djogorchock, benjamin.tissoires, linux-input, linux-kernel,
	Abaci Robot

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 <abaci@linux.alibaba.com>
> Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=7992
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>

Applied, thanks.

-- 
Jiri Kosina
SUSE Labs


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] HID: nintendo: Remove some unused functions
@ 2024-01-26  7:54 Jiapeng Chong
  2024-02-13 15:25 ` Jiri Kosina
  0 siblings, 1 reply; 7+ messages in thread
From: Jiapeng Chong @ 2024-01-26  7:54 UTC (permalink / raw)
  To: djogorchock
  Cc: jikos, benjamin.tissoires, linux-input, linux-kernel,
	Jiapeng Chong, Abaci Robot

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(-)

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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] HID: nintendo: Remove some unused functions
  2024-01-26  7:54 Jiapeng Chong
@ 2024-02-13 15:25 ` Jiri Kosina
  0 siblings, 0 replies; 7+ messages in thread
From: Jiri Kosina @ 2024-02-13 15:25 UTC (permalink / raw)
  To: Jiapeng Chong
  Cc: djogorchock, benjamin.tissoires, linux-input, linux-kernel,
	Abaci Robot, Ryan McClelland

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
> 

-- 
Jiri Kosina
SUSE Labs


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] HID: nintendo: Remove some unused functions
@ 2024-05-31  8:55 Jiapeng Chong
  2024-06-04  9:05 ` Jiri Kosina
  0 siblings, 1 reply; 7+ messages in thread
From: Jiapeng Chong @ 2024-05-31  8:55 UTC (permalink / raw)
  To: djogorchock
  Cc: jikos, bentiss, linux-input, linux-kernel, Jiapeng Chong,
	Abaci Robot

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

drivers/hid/hid-nintendo.c:672:20: warning: unused function 'joycon_device_is_procon'.
drivers/hid/hid-nintendo.c:682:20: warning: unused function 'joycon_device_is_snescon'.
drivers/hid/hid-nintendo.c:687:20: warning: unused function 'joycon_device_is_gencon'.
drivers/hid/hid-nintendo.c:692:20: warning: unused function 'joycon_device_is_n64con'.

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

diff --git a/drivers/hid/hid-nintendo.c b/drivers/hid/hid-nintendo.c
index b4a97803eca3..be7f7e47d65f 100644
--- a/drivers/hid/hid-nintendo.c
+++ b/drivers/hid/hid-nintendo.c
@@ -658,7 +658,6 @@ struct joycon_ctlr {
 	(ctlr->ctlr_type == JOYCON_CTLR_TYPE_JCR || \
 	 ctlr->ctlr_type == JOYCON_CTLR_TYPE_PRO)
 
-
 /*
  * Controller device helpers
  *
@@ -669,31 +668,11 @@ 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_procon(struct joycon_ctlr *ctlr)
-{
-	return ctlr->hdev->product == USB_DEVICE_ID_NINTENDO_PROCON;
-}
-
 static inline bool joycon_device_is_chrggrip(struct joycon_ctlr *ctlr)
 {
 	return ctlr->hdev->product == USB_DEVICE_ID_NINTENDO_CHRGGRIP;
 }
 
-static inline bool joycon_device_is_snescon(struct joycon_ctlr *ctlr)
-{
-	return ctlr->hdev->product == USB_DEVICE_ID_NINTENDO_SNESCON;
-}
-
-static inline bool joycon_device_is_gencon(struct joycon_ctlr *ctlr)
-{
-	return ctlr->hdev->product == USB_DEVICE_ID_NINTENDO_GENCON;
-}
-
-static inline bool joycon_device_is_n64con(struct joycon_ctlr *ctlr)
-{
-	return ctlr->hdev->product == USB_DEVICE_ID_NINTENDO_N64CON;
-}
-
 /*
  * Controller type helpers
  *
-- 
2.20.1.7.g153144c


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] HID: nintendo: Remove some unused functions
  2024-05-31  8:55 Jiapeng Chong
@ 2024-06-04  9:05 ` Jiri Kosina
  0 siblings, 0 replies; 7+ messages in thread
From: Jiri Kosina @ 2024-06-04  9:05 UTC (permalink / raw)
  To: Jiapeng Chong
  Cc: djogorchock, bentiss, linux-input, linux-kernel, Abaci Robot

On Fri, 31 May 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:672:20: warning: unused function 'joycon_device_is_procon'.
> drivers/hid/hid-nintendo.c:682:20: warning: unused function 'joycon_device_is_snescon'.
> drivers/hid/hid-nintendo.c:687:20: warning: unused function 'joycon_device_is_gencon'.
> drivers/hid/hid-nintendo.c:692:20: warning: unused function 'joycon_device_is_n64con'.
> 
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=9265
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>

Applied, thanks.

-- 
Jiri Kosina
SUSE Labs


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-06-04  9:05 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-19  7:27 [PATCH] HID: nintendo: Remove some unused functions Jiapeng Chong
2024-01-19 20:12 ` Silvan Jegen
2024-01-23 10:20 ` Jiri Kosina
  -- strict thread matches above, loose matches on Subject: below --
2024-01-26  7:54 Jiapeng Chong
2024-02-13 15:25 ` Jiri Kosina
2024-05-31  8:55 Jiapeng Chong
2024-06-04  9:05 ` Jiri Kosina

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox