OSDN Git Service

usb: cdnsp: remove redundant initialization of variable ret
authorColin Ian King <colin.king@canonical.com>
Fri, 26 Mar 2021 19:13:57 +0000 (19:13 +0000)
committerPeter Chen <peter.chen@kernel.org>
Mon, 12 Apr 2021 12:19:22 +0000 (20:19 +0800)
The variable ret 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>
Reviewed-by: Pawel Laszczak <pawell@cadence.com>
Signed-off-by: Peter Chen <peter.chen@kernel.org>
drivers/usb/cdns3/cdnsp-mem.c

index 1d1b9a4..5d4c4bf 100644 (file)
@@ -686,7 +686,7 @@ static void cdnsp_free_priv_device(struct cdnsp_device *pdev)
 
 static int cdnsp_alloc_priv_device(struct cdnsp_device *pdev)
 {
-       int ret = -ENOMEM;
+       int ret;
 
        ret = cdnsp_init_device_ctx(pdev);
        if (ret)