From patchwork Sun Jun 1 12:44:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rickard Strandqvist X-Patchwork-Id: 4278041 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 4305D9F1D6 for ; Sun, 1 Jun 2014 12:43:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 42D4020351 for ; Sun, 1 Jun 2014 12:43:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7DE3120340 for ; Sun, 1 Jun 2014 12:43:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752130AbaFAMnV (ORCPT ); Sun, 1 Jun 2014 08:43:21 -0400 Received: from mail-wi0-f172.google.com ([209.85.212.172]:59133 "EHLO mail-wi0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756261AbaFAMnU (ORCPT ); Sun, 1 Jun 2014 08:43:20 -0400 Received: by mail-wi0-f172.google.com with SMTP id hi2so3209109wib.17 for ; Sun, 01 Jun 2014 05:43:19 -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=Xi0tJMP3NXVo/GZnoh6bmr6WuhCieidmvKhWI4VWEdI=; b=jR/hIKO0iMP6qubididQheA5yGtmx0MZs7pcmUtDLvs8Cu3rP3ztiCmUuig1V7HR3p GigC10BOv2AEkqLS6CQJH7ss6EV8jhaVMi+J5F0O32A+s6amuvMTsgIFeuI7Xz7bW/e0 cRX07wUCx12Ift1uV0/CRAruw42LL62LTxR70V47sxn51H4rFMvkMiGnKx4ZNQ/wFjXV 4bal0qKrY/UdsAXxSewo6kTsry7wgsqP8luyt/BHD2oMB8KQCfrmHyuqTCBiX/o/9cWE 2GJiq9tcX97TiqdFI5lG/Hyjt56MFJ/q2E+HBQaXmRwExfRig/Ow11yqXnlVu+TM4Rfk hhvQ== X-Gm-Message-State: ALoCoQmdnLto2fwfSY1M+/iminRrY7E0mR561jO/bdYZ29GVnmLe3UiBQywQPmMSu4I1zRZDNs7b X-Received: by 10.194.81.98 with SMTP id z2mr41505037wjx.12.1401626599114; Sun, 01 Jun 2014 05:43:19 -0700 (PDT) Received: from localhost.localdomain (h-245-62.a218.priv.bahnhof.se. [85.24.245.62]) by mx.google.com with ESMTPSA id ch16sm4970150wjb.25.2014.06.01.05.43.17 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 01 Jun 2014 05:43:18 -0700 (PDT) From: Rickard Strandqvist To: Ivo van Doorn , Helmut Schaa Cc: Rickard Strandqvist , "John W. Linville" , linux-wireless@vger.kernel.org, users@rt2x00.serialmonkey.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] net: wireless: rt2x00: rt2x00mac.c: Cleaning up uninitialized variables Date: Sun, 1 Jun 2014 14:44:13 +0200 Message-Id: <1401626653-15842-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 variable will be used without being initialized. This was largely found by using a static code analysis program called cppcheck. Signed-off-by: Rickard Strandqvist --- drivers/net/wireless/rt2x00/rt2x00mac.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/wireless/rt2x00/rt2x00mac.c b/drivers/net/wireless/rt2x00/rt2x00mac.c index a87ee9b..98f440a 100644 --- a/drivers/net/wireless/rt2x00/rt2x00mac.c +++ b/drivers/net/wireless/rt2x00/rt2x00mac.c @@ -798,6 +798,8 @@ int rt2x00mac_set_antenna(struct ieee80211_hw *hw, u32 tx_ant, u32 rx_ant) setup.tx = tx_ant; setup.rx = rx_ant; + setup.rx_chain_num = 0; + setup.tx_chain_num = 0; rt2x00lib_config_antenna(rt2x00dev, setup);