Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2902305ybb; Mon, 30 Mar 2020 15:39:14 -0700 (PDT) X-Google-Smtp-Source: ADFU+vu/arkA1dXepgt+z2BudCae8vTouRzP7g9yV4+M2hlYhrsODUWHeYZB3TMv/0LeDa6RkSIa X-Received: by 2002:a4a:8241:: with SMTP id t1mr11148100oog.57.1585607954142; Mon, 30 Mar 2020 15:39:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585607954; cv=none; d=google.com; s=arc-20160816; b=dapMKaBJ1GBi7L6ktgHgG8RX0h5KHl6ZpVKD403+2KYRrdKr9DeVoCJZurZ2K7dYb8 Rf8ewZ2lLvFjS21cISc4swlD+wTNWPnRKwtxXOGEsrIxhMF1HA6hZgHAF7vG9gieZrMB Ci3+/Y8NA7ajx9g7t6SxL59YEtNS6gm4gjoi9X6/zTrOT9Z6E/81seFl6OEG0b5GcPsx KOFX0370OQPVSGKYb6v5Orfsm42KFdYDLfZB/y7ej5yzZYu1zhy0U0hZyCelQ1RdSTOy yRflj0AfqU7XjDrUS8DAylRmsHtOyvSoxsQWusRkgKJhRqN/Fqdu1fkkiXLzbi1blk9J ZwRg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=YkvMuoIYK/X5jlUXAbGp136wP0Q9T5tr7KcVd6q5dxI=; b=FGUN88spHShCAzGswyEF/13qCHlwuK6iTSmiAkvSpvBfp6oHO6W0U+gGmpaZ6fC+JU QqNqS4YCyRY2g4dit95ReuB19aNy6vVhfCcqk4YaFI0tn29sgCfnXMNCAXDUGLLTH06G K26MTWdQsPAMs99ixiGL9KbzsRk3DVqL7L+NKabUBCessFSF2QlhsM2T9Yg1zNnVYZup o1tNqKRMObWLDGnbh5Ujzm2/+tU41B+bBMxeVTRdMrAyV/5Zq7gQOA6PGodGeRUkcxw4 vMvJ43vLZ7GYMJOOqQSFoQy5rzdlm+4Hp6bS9bL0JOOGeIN0zg3URnYKSzKQuqRbOUeC FUcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="SYt0aT//"; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s12si6801341otd.288.2020.03.30.15.39.00; Mon, 30 Mar 2020 15:39:14 -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=@gmail.com header.s=20161025 header.b="SYt0aT//"; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729129AbgC3Wha (ORCPT + 99 others); Mon, 30 Mar 2020 18:37:30 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:42867 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728876AbgC3Wha (ORCPT ); Mon, 30 Mar 2020 18:37:30 -0400 Received: by mail-pl1-f195.google.com with SMTP id e1so7325643plt.9 for ; Mon, 30 Mar 2020 15:37:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=YkvMuoIYK/X5jlUXAbGp136wP0Q9T5tr7KcVd6q5dxI=; b=SYt0aT//aArSMQ/UNzfekQzd0uvKBRqacpgJcWiAUN7HREbwlIsEVwcinfFwcBTEFA /fI0lPz5LZkn8m9qzEqPVK4DtytYMrndVNcN37GQV3SnDVElPUpPs5kwj99gYr8rE9Uv wK3jp5lDTiEip7wtN1BvRmYG6Q73TkRYHgW+nB3JW6Q2kiPaq6JlK8yucO6wsGc7weFr 5MWJgKScJEl7yYRkpxIJobghTWzpJXGHqf48Lz99CpLNLM+KXZXl71l3XgoCuW2JY6LR NIvvbyxcFjKhs+ByXJnTOna1I58jRULZ9ldefpACM0lclCci8ybYTqNKiSoWA1od7QIz Yt6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=YkvMuoIYK/X5jlUXAbGp136wP0Q9T5tr7KcVd6q5dxI=; b=lLy9yPO8Ni8SAdSX+Yx1WxsKmYCkA/KekUxHBI+GO8J1Vvc0CyuUPEPIq5gb28cV6D 25wmo7jH2kDQTU1gmh9K6llLwCKeqkbcilsQeZ8qXyO+FLCVg+fmWX3NVhrZM9MU4qAR eSafEsKzOw+yzuWJQL838gisNfYvi8eOSIjFJn4ytgBewtroJ7cjpfUaKu1i01PJ4nVk v6Ln4B+zxjlODpTD1ic/LYBRVF1oXIotz/W8I1m1+auIk1ccXQKRyq1gt4D8EwKNCZgg IVZIXwQfENGK5MnYeeUmJd6FI8GVC8k5fbD8m5pRZISypwqw8+J2ux4VlhQ3J4y079+b TRcg== X-Gm-Message-State: AGi0PuYfBgHwJpe88gJzaG+6Aq9nBL47+AJ8gm4VdS4Rh4Y045NSPskm aY3d9t7aC6oE+bozYmP2u58= X-Received: by 2002:a17:90a:240f:: with SMTP id h15mr385069pje.176.1585607848766; Mon, 30 Mar 2020 15:37:28 -0700 (PDT) Received: from OptiPlexFedora.fios-router.home ([47.144.161.84]) by smtp.gmail.com with ESMTPSA id m14sm474522pje.19.2020.03.30.15.37.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Mar 2020 15:37:28 -0700 (PDT) From: "John B. Wyatt IV" To: outreachy-kernel@googlegroups.com, Julia Lawall , Stefano Brivio , Forest Bond , Greg Kroah-Hartman , Quentin Deslandes , Colin Ian King , Malcolm Priestley , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Cc: "John B. Wyatt IV" Subject: [PATCH v7] staging: vt6656: add error code handling to unused variable Date: Mon, 30 Mar 2020 15:37:18 -0700 Message-Id: <20200330223718.33885-1-jbwyatt4@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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)); + if (ret) + return ret; } - vnt_mac_reg_bits_off(priv, MAC_REG_GPIOCTL1, GPIO3_INTMD); - - return ret; + return vnt_mac_reg_bits_off(priv, MAC_REG_GPIOCTL1, GPIO3_INTMD); } void vnt_set_bss_mode(struct vnt_private *priv) -- 2.25.1