From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D063DC54E49 for ; Sun, 10 May 2020 07:41:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 49DF020801 for ; Sun, 10 May 2020 07:41:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=mork.no header.i=@mork.no header.b="olgW/Ws8" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728340AbgEJHl3 (ORCPT ); Sun, 10 May 2020 03:41:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725810AbgEJHl2 (ORCPT ); Sun, 10 May 2020 03:41:28 -0400 Received: from canardo.mork.no (canardo.mork.no [IPv6:2001:4641::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F655C061A0C; Sun, 10 May 2020 00:41:27 -0700 (PDT) Received: from miraculix.mork.no (miraculix.mork.no [IPv6:2001:4641:0:2:7627:374e:db74:e353]) (authenticated bits=0) by canardo.mork.no (8.15.2/8.15.2) with ESMTPSA id 04A7fH88024809 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sun, 10 May 2020 09:41:17 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mork.no; s=b; t=1589096478; bh=0ektno/eixWqJUCCiVzDc/aHhKtbibJjf6a3mIpikDc=; h=From:To:Cc:Subject:References:Date:Message-ID:From; b=olgW/Ws8kwtuB8HJdniFdFLhEJC7qutQa4C36OHLCmbDH3Img5r70ZHnXUO+z1LV1 49+FwDwaK47stz/ZyUhlq8cvlPoAxYkI75f+iLdOnrdomu0eH1Z6OekEd8J5Pdpc0W kVpLq7wQ19uIiYBYArnnxOOc+4fhZ5hih+0ocK9k= Received: from bjorn by miraculix.mork.no with local (Exim 4.92) (envelope-from ) id 1jXgaK-0008K3-RX; Sun, 10 May 2020 09:41:16 +0200 From: =?utf-8?Q?Bj=C3=B8rn_Mork?= To: Colin King Cc: "David S . Miller" , netdev@vger.kernel.org, linux-usb@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] net: usb: qmi_wwan: remove redundant assignment to variable status Organization: m References: <20200509215756.506840-1-colin.king@canonical.com> <20200509215756.506840-2-colin.king@canonical.com> Date: Sun, 10 May 2020 09:41:16 +0200 In-Reply-To: <20200509215756.506840-2-colin.king@canonical.com> (Colin King's message of "Sat, 9 May 2020 22:57:56 +0100") Message-ID: <87a72gck4j.fsf@miraculix.mork.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: clamav-milter 0.102.2 at canardo X-Virus-Status: Clean Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Colin King writes: > From: Colin Ian King > > 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 > --- > 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, bo= ol on) >=20=20 > static int qmi_wwan_bind(struct usbnet *dev, struct usb_interface *intf) > { > - int status =3D -1; > + int status; > u8 *buf =3D intf->cur_altsetting->extra; > int len =3D intf->cur_altsetting->extralen; > struct usb_interface_descriptor *desc =3D &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=C3=B8rn Mork Fixes: 8492ed45aa5d ("qmi-wwan: use common parser")