Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1326620ybb; Sun, 29 Mar 2020 01:45:15 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvVLyNk6iAK5FXNVtwU8VkD1+qQAf0kubYbtXkIOLzTvHkh9CKTajjkRYZZnDffM2Q/0nhM X-Received: by 2002:a05:6830:17ca:: with SMTP id p10mr5409698ota.165.1585471515057; Sun, 29 Mar 2020 01:45:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585471515; cv=none; d=google.com; s=arc-20160816; b=jg0ifeVLT0+4VeVHIG7kNADqXPhZ8dFHqowDryxK/zY1er+xN0dSNE/VRAALWM3U46 wQ8z6AMAdNnvZYbrOYuSwZ4WO5ERTCCu/gJB28+dmbs6Lu3P1p99EwaYdQufDkxUxiiN Jm0Y7gUefow9ebP8YzaGf3JG2vN0ntqTf8OjMI7p22yHcglifRRXpIa2Bp/E7RcB21be oq9SJs0wZ/0Heb9OlZ5cyiACBAPGbY/cBSUHR5IM256dZWhX3Phf4NjghMl9Os8CDjgp aMDTbKUDvcJsnIZJT2xzxZyxnsZ7ZrGRgywlBjVG+HaJlTH7DvLfHBuYEKVqe4JHOJu7 FNCA== 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=Id8d23gHqbRL99BSISU6PhbbkVYUSOo5XcJrW6d+fG4=; b=W3/IO+7dIjx8/5VF4GKNHgTWcaXYYfWF9GgtJZodWs+LMFdGF0CFGsMM44A3PKiME+ cD5eVY2Z6htathDUbV+9Lq+l3Tt2QrzWQWg/5TujMtPmjsHFvHMwGlT2BwyE02y05+S/ eUBtFq5kKMytG07Oi5lL07L8UqN2AKdcfYnkkAJYCUv52ifCJpFVRvHA9MMrMAX0Js9+ 2b0Sv6SOgMn+t0jLIBLM+vd/9BzcVn0NYKeSZqRgwNNsEEoHDIyw3/i+900BVp+7CEg0 UWcC4Q5jML1SGIlWTyewOrMcuJNGzFS6QYR55Nt5GXXbwpYLetWhJs6Uz3Q4evODki4H LTsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=nTg8tyH+; 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 x136si4458623oif.122.2020.03.29.01.45.02; Sun, 29 Mar 2020 01:45:15 -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=nTg8tyH+; 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 S1727866AbgC2Inf (ORCPT + 99 others); Sun, 29 Mar 2020 04:43:35 -0400 Received: from mail-pj1-f65.google.com ([209.85.216.65]:38578 "EHLO mail-pj1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726957AbgC2Inf (ORCPT ); Sun, 29 Mar 2020 04:43:35 -0400 Received: by mail-pj1-f65.google.com with SMTP id m15so5897686pje.3 for ; Sun, 29 Mar 2020 01:43:34 -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=Id8d23gHqbRL99BSISU6PhbbkVYUSOo5XcJrW6d+fG4=; b=nTg8tyH+FegLXOkebwiGJ2y9whQZ/BxUnZJf/tkkoeL2aw3TZOllyMdv0NSpfV9cEm MHJFWMcK3dkxiL5EnQ48t+1t2c0xQDnT3yr/gVUAr8sSTS70FQQI6VI6jxGSuXiMGzoJ trkwSu6ZaJXH72eyjvNobSkiz060K1jBvdfqbpYE/FBTo0sKuvxPNGZVNiurkFt43s9Q Rz5YLdooUXeUK+8V1/Xp9fxGm94aacy4hSkV9z7i+8OXWkxmwdmzNuQ3aIGppdSm1Nng ruUN5weC++HGmv7H972u2CwQ6MpeqIBgClgA7q8vHiBQ8nI0+Ktle5mEXpnBxC5mJssN /etQ== 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=Id8d23gHqbRL99BSISU6PhbbkVYUSOo5XcJrW6d+fG4=; b=r+3CCiEwo2atZP2I6hSDh6Uol49dEQNAt1D36VFJk4QVg7mcE53YTLVL5rn49swKzJ 8RDF4UtUAKDLqhcR1BYiNh9Uu1EfOH6TMUCCG2a3k/v6FfNW37vDBdluweVkeqqTOOLV NZeap4Rg9l2ouDCa318chA4sp3owxTrETzfPtvduPdnpTTUrC3dl37vPYP3YseC909AY zRv90IFs1/Bk9eO7t9TPAAEV+1rhMDQS63Q6hjVqTCwcHvLMMrMp3ksPGXAr/tn26f4W trPHDtnHDCAWHTPiNV6+CzLeihgYh3jWdRGY+G+kZgA9z0lZIaW1BY9i+YuTYub8xOSi F5xg== X-Gm-Message-State: ANhLgQ2tb2KJxJX6rRRs/q/fczfD2GYcUuUw4mQU/f5kTKh/JTA1yXb3 2sNWM3Vsp85d7YTHD0yRado= X-Received: by 2002:a17:90a:b003:: with SMTP id x3mr9264046pjq.140.1585471414051; Sun, 29 Mar 2020 01:43:34 -0700 (PDT) Received: from OptiPlexFedora.fios-router.home ([47.144.161.84]) by smtp.gmail.com with ESMTPSA id w2sm1525487pff.195.2020.03.29.01.43.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Mar 2020 01:43:33 -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 v3] staging: vt6656: add error code handling to unused variable Date: Sun, 29 Mar 2020 01:43:20 -0700 Message-Id: <20200329084320.619503-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 Signed-off-by: John B. Wyatt IV --- 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 | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/drivers/staging/vt6656/card.c b/drivers/staging/vt6656/card.c index dc3ab10eb630..239012539e73 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)); + ret = vnt_mac_reg_bits_on(priv, MAC_REG_SOFTPWRCTL, + (SOFTPWRCTL_SWPE2 | SOFTPWRCTL_SWPE3)); break; } + 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