* [PATCH] HID: usbhid: remove redundant assignment to variable retval
@ 2020-06-10 12:31 Colin King
2020-06-16 15:17 ` Jiri Kosina
0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2020-06-10 12:31 UTC (permalink / raw)
To: Jiri Kosina, Benjamin Tissoires, linux-usb, linux-input
Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
The variable retval is being initialized with a value that is
never read and it is being updated later with a new value. The
initialization is redundant and can be removed.
Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/hid/usbhid/hid-core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c
index 17a638f15082..17a29ee0ac6c 100644
--- a/drivers/hid/usbhid/hid-core.c
+++ b/drivers/hid/usbhid/hid-core.c
@@ -1667,7 +1667,7 @@ struct usb_interface *usbhid_find_interface(int minor)
static int __init hid_init(void)
{
- int retval = -ENOMEM;
+ int retval;
retval = hid_quirks_init(quirks_param, BUS_USB, MAX_USBHID_BOOT_QUIRKS);
if (retval)
--
2.27.0.rc0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] HID: usbhid: remove redundant assignment to variable retval
2020-06-10 12:31 [PATCH] HID: usbhid: remove redundant assignment to variable retval Colin King
@ 2020-06-16 15:17 ` Jiri Kosina
0 siblings, 0 replies; 2+ messages in thread
From: Jiri Kosina @ 2020-06-16 15:17 UTC (permalink / raw)
To: Colin King
Cc: Benjamin Tissoires, linux-usb, linux-input, kernel-janitors,
linux-kernel
On Wed, 10 Jun 2020, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> The variable retval is being initialized with a value that is
> never read and it is being updated later with a new value. The
> initialization is redundant and can be removed.
>
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
> drivers/hid/usbhid/hid-core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c
> index 17a638f15082..17a29ee0ac6c 100644
> --- a/drivers/hid/usbhid/hid-core.c
> +++ b/drivers/hid/usbhid/hid-core.c
> @@ -1667,7 +1667,7 @@ struct usb_interface *usbhid_find_interface(int minor)
>
> static int __init hid_init(void)
> {
> - int retval = -ENOMEM;
> + int retval;
>
> retval = hid_quirks_init(quirks_param, BUS_USB, MAX_USBHID_BOOT_QUIRKS);
> if (retval)
Applied, thanks.
--
Jiri Kosina
SUSE Labs
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-06-16 15:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-10 12:31 [PATCH] HID: usbhid: remove redundant assignment to variable retval Colin King
2020-06-16 15:17 ` Jiri Kosina
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).