Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp2629647ybb; Mon, 30 Mar 2020 09:47:31 -0700 (PDT) X-Google-Smtp-Source: ADFU+vv8xo99BsypvLeyfYpXx9yKc2lcMe6qtqK+WXlFLwxdg6LwRgFwVZ49Vpl5wBbeZr/UCuCC X-Received: by 2002:a4a:4190:: with SMTP id x138mr10183783ooa.35.1585586851135; Mon, 30 Mar 2020 09:47:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585586851; cv=none; d=google.com; s=arc-20160816; b=MNbmGEYou8aRu3MV+peYxLCZbmh3GSgf9TmprTafJsAI5MtVfbEy5+sNKWGHgjgo9S 5q29w6rdGVIeK9Gr4yTOaGTdBtQgBNOXKbeU7vyuOu5JfhEhGuwOxAtf/wwBv6/OSveB stoggYCAYxPhv9TVZ6vlBJw+BnmjuRAQlub0ANLD6zgyj/ShbXlNvLKN3zFNMRZwnDaU JTZM+p6VXw7gZvoRTB37gcUR5FIS+K4Al2dlfp9o1HOzMN1R4TrBbzvelL0F/4CjuDs0 s2ODD8tlbrH3bWJE0PHjhR8mk2RQ8sUUHGjso0oJHd0+CAYFYugXjHDSHhUVdmQDznRQ xjlg== 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=1jHmmqwn2svjDpJo/PqcecI2nv0o43iwqhoUvWD12Vs=; b=Uuc2bRgarmlBQ1Bun68+TfWG/rjHIZaKlRngzlGk5Mc4eadVa/QDWVRzwETdOck0Eb jGzCgbfEtHztpbbYfUVuLuccMYE4+gt6z0ipQL+apJOVRz5ZLbyUUNRdnWoBpKnie54l l9KXpEYDKOaaUmTaTltcgfPEWI8x0mIHsFnIfMuRJQT8g9zmoxIspN7DoFv7XTZWgLSJ yGaY4aSdAkLX4yVET+3Cy+hGhkiHwHeSeE+kFMv2Cdlr6TAHbXg5x+suCAmqbPD+Wigl AVkJV00JSS1JCp1viaJXnWUkW+z10bAXwldZBya8ndaoIQNkF4e/IyoSwvaeEL5DneeO FFsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=UtaEHMs0; 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 f77si6850273oob.89.2020.03.30.09.47.18; Mon, 30 Mar 2020 09:47:31 -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=UtaEHMs0; 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 S1729870AbgC3Qp6 (ORCPT + 99 others); Mon, 30 Mar 2020 12:45:58 -0400 Received: from mail-pg1-f178.google.com ([209.85.215.178]:37351 "EHLO mail-pg1-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726085AbgC3Qp5 (ORCPT ); Mon, 30 Mar 2020 12:45:57 -0400 Received: by mail-pg1-f178.google.com with SMTP id a32so8920963pga.4 for ; Mon, 30 Mar 2020 09:45:56 -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=1jHmmqwn2svjDpJo/PqcecI2nv0o43iwqhoUvWD12Vs=; b=UtaEHMs0yz7OzsCgZpF68S16mE3rpzMGRscsJpWv+NrjN1/ike3O51+Q+Wejvo0baN m0UHlGFc13NiDBP55M5QExJcxOwwqQSiwT4ODoytwiX5YW75t9VaupearIW/bs/UXUak iGToo5V8SQQIEquNd4I5b4wNnAQJQrgBXhpPFFzplNKWpTZoQvUpGjd918V4WKC0/6n9 16Edgr0PuVfUlvAJDA53+FiCxJvO6m1S5L8UnUMrnk+sHrcZyJUyRwcYpmXeMHlIDOUn WAuQ8OfjPo03bghgj+9d7Vy1bvTI04+PUxWBsPxxvsjk8P9nOWk3NV71Kwwzinr9uE3A kOBA== 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=1jHmmqwn2svjDpJo/PqcecI2nv0o43iwqhoUvWD12Vs=; b=Y23h5PGvApGkII5foj2OindfwhAM32GLscZY1TtGstsTlFvUCtA3sn2lrI8AG7aOPt qNU6384oon6ITBMkgiBue9Z/RnuNHcs/w6SRkJrX9PVqpOUb0uJTN6QGahFI+NP/vXjd x1hCzmJpvu5sTqPw1wZEWbmFfDxdUFlZx+k3BCCRknt4XueubynqklL9lxMIIv8RyRk+ 1ErPK4kiQL2V7xO8kXO2DzmNotcG1lh1h4RrCw6Trl9kTMb0wnW9fDkJVQh2cXbv6ENl wTOMfBARmohkApWlNwXPtY8MqiTVb0YpmymIsVwDln31KJ2d9BI2MOctRRWClgQzQiUF QcuA== X-Gm-Message-State: ANhLgQ2JtoCWsmefLt3eRVddArIH85Nk02tNx+hmnrUsTLD2PV58wlb/ OxW8LWw863tLEoZpxz6AE2Y= X-Received: by 2002:a05:6a00:42:: with SMTP id i2mr13604943pfk.108.1585586756115; Mon, 30 Mar 2020 09:45:56 -0700 (PDT) Received: from OptiPlexFedora.fios-router.home ([47.144.161.84]) by smtp.gmail.com with ESMTPSA id d3sm56194pjz.2.2020.03.30.09.45.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Mar 2020 09:45:55 -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 v4] staging: vt6656: add error code handling to unused variable Date: Mon, 30 Mar 2020 09:45:30 -0700 Message-Id: <20200330164530.2919-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 Suggested-by: Julia Lawall Reviewed-by: Quentin Deslandes Signed-off-by: John B. Wyatt IV --- v4: Move Suggested-by: Julia Lawall above seperator line. Add Reviewed-by tag as requested by Quentin Deslandes. Suggested-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 | 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