* [PATCH] HID: playstation: remove unreachable code
@ 2023-01-06 2:47 Jiapeng Chong
0 siblings, 0 replies; 3+ messages in thread
From: Jiapeng Chong @ 2023-01-06 2:47 UTC (permalink / raw)
To: roderick.colenbrander
Cc: jikos, benjamin.tissoires, rydberg, linux-input, linux-kernel,
Jiapeng Chong, Abaci Robot
The function dualshock4_get_calibration_data cannot execute hid_err,
delete the invalid code.
drivers/hid/hid-playstation.c:1766 dualshock4_get_calibration_data() warn: ignoring unreachable code.
Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3641
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
drivers/hid/hid-playstation.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/hid/hid-playstation.c b/drivers/hid/hid-playstation.c
index f399bf0d3c8c..8fef1498c397 100644
--- a/drivers/hid/hid-playstation.c
+++ b/drivers/hid/hid-playstation.c
@@ -1763,11 +1763,8 @@ static int dualshock4_get_calibration_data(struct dualshock4 *ds4)
ret = -EILSEQ;
goto err_free;
}
- hid_err(hdev, "Failed to retrieve DualShock4 calibration info: %d\n", ret);
- goto err_free;
- } else {
+ } else
break;
- }
}
} else { /* Bluetooth */
buf = kzalloc(DS4_FEATURE_REPORT_CALIBRATION_BT_SIZE, GFP_KERNEL);
--
2.20.1.7.g153144c
^ permalink raw reply related [flat|nested] 3+ messages in thread* [PATCH] HID: playstation: remove unreachable code
@ 2022-11-15 5:39 Jiapeng Chong
2022-11-15 15:41 ` Roderick Colenbrander
0 siblings, 1 reply; 3+ messages in thread
From: Jiapeng Chong @ 2022-11-15 5:39 UTC (permalink / raw)
To: roderick.colenbrander
Cc: jikos, benjamin.tissoires, rydberg, linux-input, linux-kernel,
Jiapeng Chong, Abaci Robot
The function dualshock4_get_calibration_data cannot execute hid_err,
delete the invalid code.
drivers/hid/hid-playstation.c:1766 dualshock4_get_calibration_data() warn: ignoring unreachable code.
Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3073
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
drivers/hid/hid-playstation.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/hid/hid-playstation.c b/drivers/hid/hid-playstation.c
index bae3e712a562..a4106f760d1f 100644
--- a/drivers/hid/hid-playstation.c
+++ b/drivers/hid/hid-playstation.c
@@ -1763,8 +1763,6 @@ static int dualshock4_get_calibration_data(struct dualshock4 *ds4)
ret = -EILSEQ;
goto err_free;
}
- hid_err(hdev, "Failed to retrieve DualShock4 calibration info: %d\n", ret);
- goto err_free;
} else {
break;
}
--
2.20.1.7.g153144c
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] HID: playstation: remove unreachable code
2022-11-15 5:39 Jiapeng Chong
@ 2022-11-15 15:41 ` Roderick Colenbrander
0 siblings, 0 replies; 3+ messages in thread
From: Roderick Colenbrander @ 2022-11-15 15:41 UTC (permalink / raw)
To: Jiapeng Chong
Cc: roderick.colenbrander, jikos, benjamin.tissoires, rydberg,
linux-input, linux-kernel, Abaci Robot
On Mon, Nov 14, 2022 at 9:40 PM Jiapeng Chong
<jiapeng.chong@linux.alibaba.com> wrote:
>
> The function dualshock4_get_calibration_data cannot execute hid_err,
> delete the invalid code.
>
> drivers/hid/hid-playstation.c:1766 dualshock4_get_calibration_data() warn: ignoring unreachable code.
>
> Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3073
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
> ---
> drivers/hid/hid-playstation.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/drivers/hid/hid-playstation.c b/drivers/hid/hid-playstation.c
> index bae3e712a562..a4106f760d1f 100644
> --- a/drivers/hid/hid-playstation.c
> +++ b/drivers/hid/hid-playstation.c
> @@ -1763,8 +1763,6 @@ static int dualshock4_get_calibration_data(struct dualshock4 *ds4)
> ret = -EILSEQ;
> goto err_free;
> }
> - hid_err(hdev, "Failed to retrieve DualShock4 calibration info: %d\n", ret);
> - goto err_free;
> } else {
> break;
> }
> --
> 2.20.1.7.g153144c
>
Thanks for pointing this out. The error message is actually needed and
should be moved either in the else statement or we just take the else
statement.
Thanks,
Roderick
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-01-06 2:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-06 2:47 [PATCH] HID: playstation: remove unreachable code Jiapeng Chong
-- strict thread matches above, loose matches on Subject: below --
2022-11-15 5:39 Jiapeng Chong
2022-11-15 15:41 ` Roderick Colenbrander
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox