From patchwork Sun Jun 1 20:14:38 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rickard Strandqvist X-Patchwork-Id: 4279111 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C216B9F326 for ; Sun, 1 Jun 2014 20:14:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EC01E2025A for ; Sun, 1 Jun 2014 20:14:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1AD7F20259 for ; Sun, 1 Jun 2014 20:14:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753258AbaFAUNr (ORCPT ); Sun, 1 Jun 2014 16:13:47 -0400 Received: from mail-wg0-f42.google.com ([74.125.82.42]:61466 "EHLO mail-wg0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752991AbaFAUNq (ORCPT ); Sun, 1 Jun 2014 16:13:46 -0400 Received: by mail-wg0-f42.google.com with SMTP id y10so4144084wgg.13 for ; Sun, 01 Jun 2014 13:13:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=EcuzDhI9/FhR412esz9LNwYN7IrBX3SOgSz515PuSNs=; b=bVqIpav3BkNPX9GWom5UyCnFk2zzaqJPGZPxLgBUkV+uEHryuQTzb9rfMS0mYzmOfj 5pzY9mBHGYX8unXS7/Mg5nK27JZ3w5KLz9DGseLhIRf1wC0R0cruLSsTg4gqEppoolAb WnW/7W6YkXcBPvItICUAe2eAQkxbMocIeJrMo6afpoVGCorYckOvmjdw/k7D1mN5tORU ifK8UtubG2rQIZaW5dqAHKVOncAkQJp7hJ/xyTIIopD6T6IZN/bNE2B7qBed/ZNjhxpg xyBanTBAZoygNaH/LRiUwuhBPpXdwbKq7Z1vc4RBczE3bZACAJtVaNVIx65tgBpZcLyy y+Rg== X-Gm-Message-State: ALoCoQmIWxje5FiYEgFOB4Jea8Nh9rgwMny4xfK7/3ziMqKSlk3kyDkJyMu0hQP2Vv5QNpjmvTNW X-Received: by 10.194.236.169 with SMTP id uv9mr42167918wjc.46.1401653624759; Sun, 01 Jun 2014 13:13:44 -0700 (PDT) Received: from localhost.localdomain (h-245-62.a218.priv.bahnhof.se. [85.24.245.62]) by mx.google.com with ESMTPSA id em7sm27621883wjd.34.2014.06.01.13.13.42 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 01 Jun 2014 13:13:43 -0700 (PDT) From: Rickard Strandqvist To: Larry Finger , Chaoming Li Cc: Rickard Strandqvist , "John W. Linville" , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] net: wireless: rtlwifi: rtl8192de: phy.c: Cleaning up uninitialized variable Date: Sun, 1 Jun 2014 22:14:38 +0200 Message-Id: <1401653678-11522-1-git-send-email-rickard_strandqvist@spectrumdigital.se> X-Mailer: git-send-email 1.7.10.4 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP There is a risk that the variables will be used without being initialized. Have also moved variable to the part of the code where it is used. This was largely found by using a static code analysis program called cppcheck. Signed-off-by: Rickard Strandqvist --- drivers/net/wireless/rtlwifi/rtl8192de/phy.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/rtlwifi/rtl8192de/phy.c b/drivers/net/wireless/rtlwifi/rtl8192de/phy.c index 3d1f0dd..592125a 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192de/phy.c +++ b/drivers/net/wireless/rtlwifi/rtl8192de/phy.c @@ -203,11 +203,12 @@ u32 rtl92d_phy_query_bb_reg(struct ieee80211_hw *hw, u32 regaddr, u32 bitmask) struct rtl_priv *rtlpriv = rtl_priv(hw); struct rtl_hal *rtlhal = rtl_hal(rtlpriv); u32 returnvalue, originalvalue, bitshift; - u8 dbi_direct; RT_TRACE(rtlpriv, COMP_RF, DBG_TRACE, "regaddr(%#x), bitmask(%#x)\n", regaddr, bitmask); if (rtlhal->during_mac1init_radioa || rtlhal->during_mac0init_radiob) { + u8 dbi_direct = 0; + /* mac1 use phy0 read radio_b. */ /* mac0 use phy1 read radio_b. */ if (rtlhal->during_mac1init_radioa)