HID: usbhid: remove redundant assignment to variable retval
diff mbox series

Message ID 20200610123101.1133117-1-colin.king@canonical.com
State New
Delegated to: Jiri Kosina
Headers show
Series
  • HID: usbhid: remove redundant assignment to variable retval
Related show

Commit Message

Colin Ian King June 10, 2020, 12:31 p.m. UTC
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(-)

Comments

Jiri Kosina June 16, 2020, 3:17 p.m. UTC | #1
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.

Patch
diff mbox series

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)