Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2905092ybb; Mon, 30 Mar 2020 15:43:26 -0700 (PDT) X-Google-Smtp-Source: ADFU+vs9AIyI8kUKWJlHUoF/RTzh+kvHk/IOEuehUFXrjj1knBA1XsrG6Qk83b9/UJQSS4CCV90j X-Received: by 2002:aca:b245:: with SMTP id b66mr256112oif.170.1585608205957; Mon, 30 Mar 2020 15:43:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585608205; cv=none; d=google.com; s=arc-20160816; b=n/b3+pfYHnovPRMj6a6pVs15KDP6LbnjNTToZVi2lhMVfqrXThW0GIRhqBeccNvbGF 92LpeGvOx0vyyJbcBcaUfmawTd8dR4U/nFLjknQfTSfmjfw0G13arPsiGHDVmJrdAiyx HKk5yDafvdLChcrYH2cT+gmV2ZHI2MMi0zLSN5srLlDIJRL/A9I1TzDnjU91Zq4eLM73 LpO9HmGn3QlE4zVJ9988zwGVOnSZ13FvFkq7XGnozgy1o8wlvCbU/GCsd+I1zpwXHZVy qrgItfPE9LPQUHjwoEJ2Pslm3PsJ/BTuBTKMasixXDhq36msD9MfTYaq0e8xNZLfJh9D yl2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=+1MMFLdM0MmXR1bUi1l23sVqviEl2BQc8iGkwz4+h/0=; b=NaHe+Kzbk4viTrSmmyUiUs1uDxbZRexcHHo/MzBnY+xIOItaWgHtd39CBXU6MYhllj xynPOhXTDPAha2srZj/zUfe4embvgYr0Q3p36BpBLIyWwPQ4QqQ0Y/2t7YRjeX6ufavQ tYaQjbp4TdUQOVa/uLYXp25gtroJGhABh9Idnfg7aDA+RAHTxvCgZ1ctDZUeMxsIda+C uHHcsyj8aIO/uNzOAvYslWKlY1YbtAFb3yGfg9s6B4wt1qGmoHiLTtS7P5bUwSv8Lk/T Z4a5FxH93Ty7HffWjxSRMNbt99iHa2d/sLsFn42iD6IHrrX0p39QekptkKOWFnu3Wx4U sJ2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="QNad5/0x"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y123si6407889oia.141.2020.03.30.15.43.12; Mon, 30 Mar 2020 15:43:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="QNad5/0x"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729146AbgC3Wma (ORCPT + 99 others); Mon, 30 Mar 2020 18:42:30 -0400 Received: from us-smtp-delivery-74.mimecast.com ([63.128.21.74]:38526 "EHLO us-smtp-delivery-74.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728876AbgC3Wm3 (ORCPT ); Mon, 30 Mar 2020 18:42:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585608148; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+1MMFLdM0MmXR1bUi1l23sVqviEl2BQc8iGkwz4+h/0=; b=QNad5/0xuIn+3pEY73vTTkSQgfgE6KFNt/9ykXDeFQLGwj9uFRRW5F8HxA3j/EKDl1FjG0 wSgtT300rTYiBtQ0FqGq7tHZlE6yEVsjDdqxELL7NsTZ/6Cen/W9haDOSy37t0g18fBwOe 0AhvRZiYwX2psl/ULE6Sl3tuYwQ2+1w= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-382-F5fCHUd8PfefDBGkdhik1w-1; Mon, 30 Mar 2020 18:42:24 -0400 X-MC-Unique: F5fCHUd8PfefDBGkdhik1w-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A51C4800D50; Mon, 30 Mar 2020 22:42:22 +0000 (UTC) Received: from elisabeth (unknown [10.36.110.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 739335DA60; Mon, 30 Mar 2020 22:42:19 +0000 (UTC) Date: Tue, 31 Mar 2020 00:42:13 +0200 From: Stefano Brivio To: "John B. Wyatt IV" Cc: outreachy-kernel@googlegroups.com, Julia Lawall , Forest Bond , Greg Kroah-Hartman , Quentin Deslandes , Colin Ian King , Malcolm Priestley , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v7] staging: vt6656: add error code handling to unused variable Message-ID: <20200331004213.1c319d94@elisabeth> In-Reply-To: <20200330223718.33885-1-jbwyatt4@gmail.com> References: <20200330223718.33885-1-jbwyatt4@gmail.com> Organization: Red Hat MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 30 Mar 2020 15:37:18 -0700 "John B. Wyatt IV" wrote: > Add error code handling to unused 'ret' variable that was never used. > Return an error code from functions called within vnt_radio_power_on. > > Issue reported by coccinelle (coccicheck). > > Suggested-by: Quentin Deslandes > Suggested-by: Stefano Brivio > Reviewed-by: Quentin Deslandes > Signed-off-by: John B. Wyatt IV > --- > v7: Move an if check. > Suggested by Stefano Brivio > > v6: Forgot to add all the v5 code to commit. > > v5: Remove Suggested-by: Julia Lawall above seperator line. > Remove break; statement in switch block. > break; removal checked by both gcc compile and checkpatch. > Suggested by Stefano Brivio > > v4: Move Suggested-by: Julia Lawall above seperator line. > Add Reviewed-by tag as requested by Quentin Deslandes. > > v3: Forgot to add v2 code changes to commit. > > v2: Replace goto statements with return. > Remove last if check because it was unneeded. > Suggested-by: Julia Lawall > > drivers/staging/vt6656/card.c | 20 ++++++++++++-------- > 1 file changed, 12 insertions(+), 8 deletions(-) > > diff --git a/drivers/staging/vt6656/card.c b/drivers/staging/vt6656/card.c > index dc3ab10eb630..df12c73097e0 100644 > --- a/drivers/staging/vt6656/card.c > +++ b/drivers/staging/vt6656/card.c > @@ -723,9 +723,13 @@ int vnt_radio_power_on(struct vnt_private *priv) > { > int ret = 0; > > - vnt_exit_deep_sleep(priv); > + ret = vnt_exit_deep_sleep(priv); > + if (ret) > + return ret; > > - vnt_mac_reg_bits_on(priv, MAC_REG_HOSTCR, HOSTCR_RXON); > + ret = vnt_mac_reg_bits_on(priv, MAC_REG_HOSTCR, HOSTCR_RXON); > + if (ret) > + return ret; > > switch (priv->rf_type) { > case RF_AL2230: > @@ -734,14 +738,14 @@ int vnt_radio_power_on(struct vnt_private *priv) > case RF_VT3226: > case RF_VT3226D0: > case RF_VT3342A0: > - vnt_mac_reg_bits_on(priv, MAC_REG_SOFTPWRCTL, > - (SOFTPWRCTL_SWPE2 | SOFTPWRCTL_SWPE3)); > - break; > + ret = vnt_mac_reg_bits_on(priv, MAC_REG_SOFTPWRCTL, > + (SOFTPWRCTL_SWPE2 | > + SOFTPWRCTL_SWPE3)); Grrr, sorry, almost there, I didn't notice this: SOFTPWRCTL_SWPE3 needs to be aligned *after* the open (useless) parenthesis: (SOFTPWRCTL_SWPE2 | SOFTPWRCTL_SWPE3)); because it's another operand of the | operation surrounded by (). Doesn't checkpatch warn? The rest looks good to me. -- Stefano