Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1325708ybb; Sun, 29 Mar 2020 01:43:10 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtWXJ65u0yHfhBH4h4PbP9dcpx7vBr70AEUvXVs+2Sbyga006DpVVS3OfR2pk+sEAmaeQGQ X-Received: by 2002:aca:db08:: with SMTP id s8mr4503938oig.167.1585471390437; Sun, 29 Mar 2020 01:43:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585471390; cv=none; d=google.com; s=arc-20160816; b=FVP2qLvq4wh2TsaIP14VfD3S+AmzsLfGCsAOzjfhRr/eXZ3VWglLMMf13foVv81B/b /69xMUajWw3NoPMKrT3gxTQ55IhW3+cgsT/on8+iT63At+8rHUc7TFgCacnrwUf0S1Gg O/T/XaElFphGva+0ayoAacBDkPL8eD8MqA+wyKImPB0jjiySjxlCbPk9S3NuluWs7jBg Xst4ZRZknhYLpu9FpZFwWZa1KhYGk/f685sZRPrV6so/9nKdILgmSs0F/5kbm/k2MZqq UCPequ4O0IC8YGW0io9VveBpsOmf+y/3nB/cRKh8kNZivseupvpx9z4/D4tPpfsyWF0E XbAg== 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=8IbFQBYANCkF12Hrlo9wNyHkWayXw9MSU6eCf6YHmKw=; b=OMWpjEzGjjlhY5kmI7YcUqbPiQOeGe4l7ytWBLHQ00+PnLM9sdczGQQojlTzfki45v THxEo48qYQYrxWQq1s5X4XONcw2MqfhULFT7xsTBKy0VQgyHPgM8LNXH4H+BHbrbH+oa niRyWTzFwzUJq8RbHCB+UUT8Mp+Kf9nR7dLszhZenAMYufPui04mwVVJbi+9E3wpMPM9 pZIhlr1TmVljBvyhNzIKwKszBeT9Z0v5cVOb3bGaWBwyAdoZ7eO/EiA4/R3watHDpKGM b7qnWrtnife0HOwPG+8ss5h7esBVQkezJfuS7ET7z+wvGcagNHzMzB+ZwCUQ5MBHOAIm mOjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=feGw5WyZ; 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.42.57; Sun, 29 Mar 2020 01:43:10 -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=feGw5WyZ; 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 S1727828AbgC2Iil (ORCPT + 99 others); Sun, 29 Mar 2020 04:38:41 -0400 Received: from mail-pj1-f68.google.com ([209.85.216.68]:52118 "EHLO mail-pj1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727286AbgC2Iil (ORCPT ); Sun, 29 Mar 2020 04:38:41 -0400 Received: by mail-pj1-f68.google.com with SMTP id w9so6103587pjh.1 for ; Sun, 29 Mar 2020 01:38:40 -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=8IbFQBYANCkF12Hrlo9wNyHkWayXw9MSU6eCf6YHmKw=; b=feGw5WyZuV9ajZvRK9bfLB9F9YycMWXf/o/b6Bw89cGi0v1Ixl7KFkr3UQfF25pdj8 f2oolo8vlDP0EVxxQmMqH+tUsBGgks7P9GiaNS74sfxP+lvhgdl8dzHDMg67pBtoB3t9 3DUfCftSZ0cV2oS/j7R23RLhccRa4SaED5bzizMTGOZYCLlG+/FJcH8eldmSDwSLSSe1 vYJGYp2pgtzF0ETGIdgSmqdAb/bhw+//jpearh6CPbMeVwxQfxRFLQW2tZ0MClw9jZJ/ sDFrZkwc/7Af7izojKVeK1f1RnqowGSlr0UsrohaodKAqtjQO0dEkYgLzMtndg79ts0x BuiA== 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=8IbFQBYANCkF12Hrlo9wNyHkWayXw9MSU6eCf6YHmKw=; b=FEOvxLPbuVoOkCTu6m69LA2iT0CY5wKlSjk/AjG/P2cw+ItyjVKbVsW7veHCNdGT+F GDBYr2R7y/TWlFnXgCfuOM6BQ+aNwNwGUZhByBnq5PPGsZKqdJwn2UjZ4G90fMy1/xxy 0c507YFn/xhG/5QvTbKYrdnMsebsiZRXFbA2JNH6hb9g8PIrsMzeYNfEFye3czv2ORfu 5GVuWtkqPsmbFyiTwbJQPCxb3daoNrDndheENYWs+pLCd9A7gcEH3hTMaXJFZuXbR5Bp SfXSANfw4cGsM6j4+G6HKp7M7eBQoTNTIqVaqVeXy5IHxecuA3XDecBqMyNjEk72wjkU khEg== X-Gm-Message-State: ANhLgQ1l9k0LpnGmmZlA/fHVDiVVCQo/9PYwPjnDghFzWMyHl20KdJRq zUhvWArzoGCkzK69FlNSghg= X-Received: by 2002:a17:90b:1a8b:: with SMTP id ng11mr9550535pjb.109.1585471119827; Sun, 29 Mar 2020 01:38:39 -0700 (PDT) Received: from OptiPlexFedora.fios-router.home ([47.144.161.84]) by smtp.gmail.com with ESMTPSA id k189sm7256529pgc.24.2020.03.29.01.38.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Mar 2020 01:38:39 -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 , Oscar Carter , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Cc: "John B. Wyatt IV" Subject: [PATCH v2] staging: vt6656: add error code handling to unused variable Date: Sun, 29 Mar 2020 01:38:29 -0700 Message-Id: <20200329083829.619127-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 --- v2: Replace goto statements with return. Remove last if check because it was unneeded. Suggested-by: Julia Lawall drivers/staging/vt6656/card.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/drivers/staging/vt6656/card.c b/drivers/staging/vt6656/card.c index dc3ab10eb630..9d23c3ec1e60 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) + goto end; - 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) + goto end; switch (priv->rf_type) { case RF_AL2230: @@ -734,13 +738,18 @@ 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) + goto end; - vnt_mac_reg_bits_off(priv, MAC_REG_GPIOCTL1, GPIO3_INTMD); + ret = vnt_mac_reg_bits_off(priv, MAC_REG_GPIOCTL1, GPIO3_INTMD); + if (ret) + goto end; +end: return ret; } -- 2.25.1