* [PATCH] usb: cdnsp: remove redundant initialization of variable ret
@ 2021-03-26 19:13 Colin King
2021-03-30 3:37 ` Pawel Laszczak
0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2021-03-26 19:13 UTC (permalink / raw)
To: Pawel Laszczak, Greg Kroah-Hartman, linux-usb
Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
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>
---
drivers/usb/cdns3/cdnsp-mem.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/cdns3/cdnsp-mem.c b/drivers/usb/cdns3/cdnsp-mem.c
index 7a84e928710e..d87b640e7b49 100644
--- a/drivers/usb/cdns3/cdnsp-mem.c
+++ b/drivers/usb/cdns3/cdnsp-mem.c
@@ -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)
--
2.30.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* RE: [PATCH] usb: cdnsp: remove redundant initialization of variable ret
2021-03-26 19:13 [PATCH] usb: cdnsp: remove redundant initialization of variable ret Colin King
@ 2021-03-30 3:37 ` Pawel Laszczak
0 siblings, 0 replies; 2+ messages in thread
From: Pawel Laszczak @ 2021-03-30 3:37 UTC (permalink / raw)
To: Colin King, Greg Kroah-Hartman, linux-usb; +Cc: kernel-janitors, linux-kernel
Hi Colin,
Thanks for this fix.
>
>From: Colin Ian King <colin.king@canonical.com>
>
>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>
>---
> drivers/usb/cdns3/cdnsp-mem.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/drivers/usb/cdns3/cdnsp-mem.c b/drivers/usb/cdns3/cdnsp-mem.c
>index 7a84e928710e..d87b640e7b49 100644
>--- a/drivers/usb/cdns3/cdnsp-mem.c
>+++ b/drivers/usb/cdns3/cdnsp-mem.c
>@@ -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)
>--
>2.30.2
Regards,
Pawel Laszczak
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-03-30 3:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-26 19:13 [PATCH] usb: cdnsp: remove redundant initialization of variable ret Colin King
2021-03-30 3:37 ` Pawel Laszczak
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).