linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] carl9170: remove unneeded NULL check
@ 2012-12-02 10:42 Dan Carpenter
  2012-12-02 13:49 ` Christian Lamparter
  0 siblings, 1 reply; 5+ messages in thread
From: Dan Carpenter @ 2012-12-02 10:42 UTC (permalink / raw)
  To: Christian Lamparter; +Cc: John W. Linville, linux-wireless, kernel-janitors

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 <dan.carpenter@oracle.com>

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);

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-12-02 22:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-02 10:42 [patch] carl9170: remove unneeded NULL check Dan Carpenter
2012-12-02 13:49 ` Christian Lamparter
2012-12-02 16:51   ` Dan Carpenter
2012-12-02 20:24     ` Christian Lamparter
2012-12-02 22:17       ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).