From patchwork Sun Dec 2 10:42:38 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 1830281 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 20C4A400ED for ; Sun, 2 Dec 2012 10:42:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753443Ab2LBKmu (ORCPT ); Sun, 2 Dec 2012 05:42:50 -0500 Received: from aserp1040.oracle.com ([141.146.126.69]:34399 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753292Ab2LBKmt (ORCPT ); Sun, 2 Dec 2012 05:42:49 -0500 Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id qB2AgbUn024206 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 2 Dec 2012 10:42:38 GMT Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158]) by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id qB2AgbGu018842 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 2 Dec 2012 10:42:37 GMT Received: from abhmt111.oracle.com (abhmt111.oracle.com [141.146.116.63]) by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id qB2AgaLZ015613; Sun, 2 Dec 2012 04:42:36 -0600 Received: from elgon.mountain (/41.212.103.53) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sun, 02 Dec 2012 02:42:36 -0800 Date: Sun, 2 Dec 2012 13:42:38 +0300 From: Dan Carpenter To: Christian Lamparter Cc: "John W. Linville" , linux-wireless@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [patch] carl9170: remove unneeded NULL check Message-ID: <20121202104238.GB16078@elgon.mountain> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: ucsinet22.oracle.com [156.151.31.94] Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org The "sta" variable is not checked for NULL consistently and it makes the static checkers complain. I asked Christian Lamparter about this and it turns out the check is not needed. "In fact, in order to set up a ampdu session, the stack would call the driver's op_ampdu_action callback which always needs a station." I have removed the check. Signed-off-by: Dan Carpenter --- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/net/wireless/ath/carl9170/tx.c b/drivers/net/wireless/ath/carl9170/tx.c index 84377cf..23d33c3 100644 --- a/drivers/net/wireless/ath/carl9170/tx.c +++ b/drivers/net/wireless/ath/carl9170/tx.c @@ -1463,6 +1463,7 @@ void carl9170_op_tx(struct ieee80211_hw *hw, struct ar9170 *ar = hw->priv; struct ieee80211_tx_info *info; struct ieee80211_sta *sta = control->sta; + struct carl9170_sta_info *stai; bool run; if (unlikely(!IS_STARTED(ar))) @@ -1479,10 +1480,8 @@ void carl9170_op_tx(struct ieee80211_hw *hw, * all ressouces which are associated with the frame. */ - if (sta) { - struct carl9170_sta_info *stai = (void *) sta->drv_priv; - atomic_inc(&stai->pending_frames); - } + stai = (void *) sta->drv_priv; + atomic_inc(&stai->pending_frames); if (info->flags & IEEE80211_TX_CTL_AMPDU) { run = carl9170_tx_ampdu_queue(ar, sta, skb);