From patchwork Thu Mar 17 18:40:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Larry Finger X-Patchwork-Id: 8613871 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 91412C0553 for ; Thu, 17 Mar 2016 18:41:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6F0E020279 for ; Thu, 17 Mar 2016 18:41:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7185120268 for ; Thu, 17 Mar 2016 18:41:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967044AbcCQSlR (ORCPT ); Thu, 17 Mar 2016 14:41:17 -0400 Received: from mail-ob0-f193.google.com ([209.85.214.193]:33383 "EHLO mail-ob0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966640AbcCQSlQ (ORCPT ); Thu, 17 Mar 2016 14:41:16 -0400 Received: by mail-ob0-f193.google.com with SMTP id z10so5779440obg.0 for ; Thu, 17 Mar 2016 11:41:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=H5QlWAVzDLbsdbsm3g03nqvvPWdKxKWU/IayFcYVDUM=; b=gleNFiWTfmjIog5NwePq2SMuo96O2dbQcoVAFaahjB7tytgaFSCQVT5Sud1V8kEmmJ EQb+ZOcBiKG3ezhwyeYproAepirbWDznLBI6/Wok/pjzwp4BwK3ecI8TVpRtQXhLqzde RBrsZ/R5/EL76n2ZM/HQMEwLpRwqWOtNo0A80MmCBotp5KKx1bD285sCUwhFrG3gRwmD cJ4iIvNW10+N6ymRV+U2Uss/VwPEjEj4pkJf4MEBAKgP+Ln4c+T4AsWFk9xQr0e9n3So +osLGaLeE87t16H9+1IsaOvf1T1fvl4lF51qdczN7+IClmmBQGpJ801fmc5B6mm0yK2q x3WQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=H5QlWAVzDLbsdbsm3g03nqvvPWdKxKWU/IayFcYVDUM=; b=WJvLzSZiBr3VQWG5w+hha/OpsZky7lf4aMtbLbZ05vwa7SNvsppKjlfgaIQUMb/wS6 iC8DUJrH1JyT68YqXZWJlSvgjTBRfif7NScvF84YsLnPNYaImsx+LXgWY5r0l8lOu7Gc M9TlQyI14FfosBbadgyKT13EfQOEQUAED/+LM+WESlGovwoX/7vMlPX7SUOBVtxf8sNy bqaSnVMetExtyt3L5X5cJce1jB6dDDPMU7TfF3fs+8jO9IPuzj1DT7pQIw5jlmHjrR08 +5EXAmU213g28p+ghcI9/wYqkwHdNwu+PAE7z/dNhSruI3qcX72+uBJsiF1hbG6dMngQ 3kmg== X-Gm-Message-State: AD7BkJK3XVmCveJcjZw5QIfAqDt8dfX0m1PwWsYPDl25GHuIFd2EevRvz7vnoUCvh5F07g== X-Received: by 10.60.92.106 with SMTP id cl10mr7085640oeb.82.1458240075300; Thu, 17 Mar 2016 11:41:15 -0700 (PDT) Received: from linux.site (cpe-24-31-249-175.kc.res.rr.com. [24.31.249.175]) by smtp.gmail.com with ESMTPSA id n5sm4221436obi.20.2016.03.17.11.41.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 17 Mar 2016 11:41:14 -0700 (PDT) From: Larry Finger To: kvalo@codeaurora.org Cc: devel@driverdev.osuosl.org, linux-wireless@vger.kernel.org, Larry Finger Subject: [PATCH 1/9] rtlwifi: Fix Smatch warnings Date: Thu, 17 Mar 2016 13:40:56 -0500 Message-Id: <1458240064-31422-2-git-send-email-Larry.Finger@lwfinger.net> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1458240064-31422-1-git-send-email-Larry.Finger@lwfinger.net> References: <1458240064-31422-1-git-send-email-Larry.Finger@lwfinger.net> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY, URIBL_BLACK 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 Smatch reports the following: CHECK drivers/net/wireless/realtek/rtlwifi/pci.c drivers/net/wireless/realtek/rtlwifi/pci.c:366 rtl_pci_check_buddy_priv() error: we previously assumed 'tpriv' could be null (see line 368) drivers/net/wireless/realtek/rtlwifi/pci.c:1216 _rtl_pci_init_struct() warn: inconsistent indenting Signed-off-by: Larry Finger --- drivers/net/wireless/realtek/rtlwifi/pci.c | 39 +++++++++++++++--------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/drivers/net/wireless/realtek/rtlwifi/pci.c b/drivers/net/wireless/realtek/rtlwifi/pci.c index 283d608..1ac41b8 100644 --- a/drivers/net/wireless/realtek/rtlwifi/pci.c +++ b/drivers/net/wireless/realtek/rtlwifi/pci.c @@ -359,30 +359,28 @@ static bool rtl_pci_check_buddy_priv(struct ieee80211_hw *hw, struct rtl_priv *rtlpriv = rtl_priv(hw); struct rtl_pci_priv *pcipriv = rtl_pcipriv(hw); bool find_buddy_priv = false; - struct rtl_priv *tpriv = NULL; + struct rtl_priv *tpriv; struct rtl_pci_priv *tpcipriv = NULL; if (!list_empty(&rtlpriv->glb_var->glb_priv_list)) { list_for_each_entry(tpriv, &rtlpriv->glb_var->glb_priv_list, list) { - if (tpriv) { - tpcipriv = (struct rtl_pci_priv *)tpriv->priv; - RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, - "pcipriv->ndis_adapter.funcnumber %x\n", - pcipriv->ndis_adapter.funcnumber); - RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, - "tpcipriv->ndis_adapter.funcnumber %x\n", - tpcipriv->ndis_adapter.funcnumber); - - if ((pcipriv->ndis_adapter.busnumber == - tpcipriv->ndis_adapter.busnumber) && - (pcipriv->ndis_adapter.devnumber == - tpcipriv->ndis_adapter.devnumber) && - (pcipriv->ndis_adapter.funcnumber != - tpcipriv->ndis_adapter.funcnumber)) { - find_buddy_priv = true; - break; - } + tpcipriv = (struct rtl_pci_priv *)tpriv->priv; + RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, + "pcipriv->ndis_adapter.funcnumber %x\n", + pcipriv->ndis_adapter.funcnumber); + RT_TRACE(rtlpriv, COMP_INIT, DBG_LOUD, + "tpcipriv->ndis_adapter.funcnumber %x\n", + tpcipriv->ndis_adapter.funcnumber); + + if ((pcipriv->ndis_adapter.busnumber == + tpcipriv->ndis_adapter.busnumber) && + (pcipriv->ndis_adapter.devnumber == + tpcipriv->ndis_adapter.devnumber) && + (pcipriv->ndis_adapter.funcnumber != + tpcipriv->ndis_adapter.funcnumber)) { + find_buddy_priv = true; + break; } } } @@ -1213,7 +1211,8 @@ static void _rtl_pci_init_struct(struct ieee80211_hw *hw, /*Tx/Rx related var */ _rtl_pci_init_trx_var(hw); - /*IBSS*/ mac->beacon_interval = 100; + /*IBSS*/ + mac->beacon_interval = 100; /*AMPDU*/ mac->min_space_cfg = 0;