* [PATCH] net: usb: qmi_wwan: remove redundant assignment to variable status
@ 2020-05-09 21:57 Colin King
2020-05-09 21:57 ` Colin King
0 siblings, 1 reply; 4+ messages in thread
From: Colin King @ 2020-05-09 21:57 UTC (permalink / raw)
To: Bjørn Mork, David S . Miller, netdev, linux-usb
Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
The variable status is being initializeed 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/net/usb/qmi_wwan.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c
index 4bb8552a00d3..b0eab6e5279d 100644
--- a/drivers/net/usb/qmi_wwan.c
+++ b/drivers/net/usb/qmi_wwan.c
@@ -719,7 +719,7 @@ static int qmi_wwan_change_dtr(struct usbnet *dev, bool on)
static int qmi_wwan_bind(struct usbnet *dev, struct usb_interface *intf)
{
- int status = -1;
+ int status;
u8 *buf = intf->cur_altsetting->extra;
int len = intf->cur_altsetting->extralen;
struct usb_interface_descriptor *desc = &intf->cur_altsetting->desc;
--
2.25.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] net: usb: qmi_wwan: remove redundant assignment to variable status
2020-05-09 21:57 [PATCH] net: usb: qmi_wwan: remove redundant assignment to variable status Colin King
@ 2020-05-09 21:57 ` Colin King
2020-05-10 7:41 ` Bjørn Mork
2020-05-10 18:14 ` Jakub Kicinski
0 siblings, 2 replies; 4+ messages in thread
From: Colin King @ 2020-05-09 21:57 UTC (permalink / raw)
To: Bjørn Mork, David S . Miller, netdev, linux-usb
Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
The variable status is being initializeed 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/net/usb/qmi_wwan.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c
index 4bb8552a00d3..b0eab6e5279d 100644
--- a/drivers/net/usb/qmi_wwan.c
+++ b/drivers/net/usb/qmi_wwan.c
@@ -719,7 +719,7 @@ static int qmi_wwan_change_dtr(struct usbnet *dev, bool on)
static int qmi_wwan_bind(struct usbnet *dev, struct usb_interface *intf)
{
- int status = -1;
+ int status;
u8 *buf = intf->cur_altsetting->extra;
int len = intf->cur_altsetting->extralen;
struct usb_interface_descriptor *desc = &intf->cur_altsetting->desc;
--
2.25.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] net: usb: qmi_wwan: remove redundant assignment to variable status
2020-05-09 21:57 ` Colin King
@ 2020-05-10 7:41 ` Bjørn Mork
2020-05-10 18:14 ` Jakub Kicinski
1 sibling, 0 replies; 4+ messages in thread
From: Bjørn Mork @ 2020-05-10 7:41 UTC (permalink / raw)
To: Colin King
Cc: David S . Miller, netdev, linux-usb, kernel-janitors, linux-kernel
Colin King <colin.king@canonical.com> writes:
> From: Colin Ian King <colin.king@canonical.com>
>
> The variable status is being initializeed 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/net/usb/qmi_wwan.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c
> index 4bb8552a00d3..b0eab6e5279d 100644
> --- a/drivers/net/usb/qmi_wwan.c
> +++ b/drivers/net/usb/qmi_wwan.c
> @@ -719,7 +719,7 @@ static int qmi_wwan_change_dtr(struct usbnet *dev, bool on)
>
> static int qmi_wwan_bind(struct usbnet *dev, struct usb_interface *intf)
> {
> - int status = -1;
> + int status;
> u8 *buf = intf->cur_altsetting->extra;
> int len = intf->cur_altsetting->extralen;
> struct usb_interface_descriptor *desc = &intf->cur_altsetting->desc;
Yes, looks like this initialization was made redundant when the CDC
descriptor parsing was moved to usbcore. Thanks.
Adding Fixes for documentation only, not as a stable hint. This is
cleanup only and not suitable for stable IMHO.
Acked-by: Bjørn Mork <bjorn@mork.no>
Fixes: 8492ed45aa5d ("qmi-wwan: use common parser")
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] net: usb: qmi_wwan: remove redundant assignment to variable status
2020-05-09 21:57 ` Colin King
2020-05-10 7:41 ` Bjørn Mork
@ 2020-05-10 18:14 ` Jakub Kicinski
1 sibling, 0 replies; 4+ messages in thread
From: Jakub Kicinski @ 2020-05-10 18:14 UTC (permalink / raw)
To: Colin King
Cc: Bjørn Mork, David S . Miller, netdev, linux-usb,
kernel-janitors, linux-kernel
On Sat, 9 May 2020 22:57:56 +0100 Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> The variable status is being initializeed 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>
Applied the 3 fixes from Saturday to net-next, thanks.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-05-10 18:14 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-09 21:57 [PATCH] net: usb: qmi_wwan: remove redundant assignment to variable status Colin King
2020-05-09 21:57 ` Colin King
2020-05-10 7:41 ` Bjørn Mork
2020-05-10 18:14 ` Jakub Kicinski
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).