[PATCH linux-next] HID: nintendo: remove redundant variables ret

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Jinpeng Cui <cui.jinpeng2@xxxxxxxxxx>

Return value directly from __joycon_hid_send() instead of
getting value from redundant variable ret.

Reported-by: Zeal Robot <zealci@xxxxxxxxxx>
Signed-off-by: Jinpeng Cui <cui.jinpeng2@xxxxxxxxxx>
---
 drivers/hid/hid-nintendo.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/hid/hid-nintendo.c b/drivers/hid/hid-nintendo.c
index 6028af3c3aae..eee569998e02 100644
--- a/drivers/hid/hid-nintendo.c
+++ b/drivers/hid/hid-nintendo.c
@@ -1378,7 +1378,6 @@ static void joycon_parse_report(struct joycon_ctlr *ctlr,
 
 static int joycon_send_rumble_data(struct joycon_ctlr *ctlr)
 {
-	int ret;
 	unsigned long flags;
 	struct joycon_rumble_output rumble_output = { 0 };
 
@@ -1403,9 +1402,8 @@ static int joycon_send_rumble_data(struct joycon_ctlr *ctlr)
 
 	joycon_enforce_subcmd_rate(ctlr);
 
-	ret = __joycon_hid_send(ctlr->hdev, (u8 *)&rumble_output,
+	return __joycon_hid_send(ctlr->hdev, (u8 *)&rumble_output,
 				sizeof(rumble_output));
-	return ret;
 }
 
 static void joycon_rumble_worker(struct work_struct *work)
-- 
2.25.1




[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux