ath9k: remove !NULL check before kfree()
authorLuis R. Rodriguez <lrodriguez@atheros.com>
Mon, 3 Aug 2009 19:24:48 +0000 (12:24 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 4 Aug 2009 20:44:31 +0000 (16:44 -0400)
kfree(NULL) works so remove all those branches which check
for it before kfree()'ing on ath9k_hw_rfdetach().

Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/phy.c

index aaa941561c36a9e75a68b13e37ef7932e82a499c..06fd057e467b261d3e2a3f01dff5eb9f8ca77921 100644 (file)
@@ -266,42 +266,32 @@ ath9k_hw_set_rf_regs(struct ath_hw *ah, struct ath9k_channel *chan,
 void
 ath9k_hw_rfdetach(struct ath_hw *ah)
 {
-       if (ah->analogBank0Data != NULL) {
-               kfree(ah->analogBank0Data);
-               ah->analogBank0Data = NULL;
-       }
-       if (ah->analogBank1Data != NULL) {
-               kfree(ah->analogBank1Data);
-               ah->analogBank1Data = NULL;
-       }
-       if (ah->analogBank2Data != NULL) {
-               kfree(ah->analogBank2Data);
-               ah->analogBank2Data = NULL;
-       }
-       if (ah->analogBank3Data != NULL) {
-               kfree(ah->analogBank3Data);
-               ah->analogBank3Data = NULL;
-       }
-       if (ah->analogBank6Data != NULL) {
-               kfree(ah->analogBank6Data);
-               ah->analogBank6Data = NULL;
-       }
-       if (ah->analogBank6TPCData != NULL) {
-               kfree(ah->analogBank6TPCData);
-               ah->analogBank6TPCData = NULL;
-       }
-       if (ah->analogBank7Data != NULL) {
-               kfree(ah->analogBank7Data);
-               ah->analogBank7Data = NULL;
-       }
-       if (ah->addac5416_21 != NULL) {
-               kfree(ah->addac5416_21);
-               ah->addac5416_21 = NULL;
-       }
-       if (ah->bank6Temp != NULL) {
-               kfree(ah->bank6Temp);
-               ah->bank6Temp = NULL;
-       }
+       kfree(ah->analogBank0Data);
+       ah->analogBank0Data = NULL;
+
+       kfree(ah->analogBank1Data);
+       ah->analogBank1Data = NULL;
+
+       kfree(ah->analogBank2Data);
+       ah->analogBank2Data = NULL;
+
+       kfree(ah->analogBank3Data);
+       ah->analogBank3Data = NULL;
+
+       kfree(ah->analogBank6Data);
+       ah->analogBank6Data = NULL;
+
+       kfree(ah->analogBank6TPCData);
+       ah->analogBank6TPCData = NULL;
+
+       kfree(ah->analogBank7Data);
+       ah->analogBank7Data = NULL;
+
+       kfree(ah->addac5416_21);
+       ah->addac5416_21 = NULL;
+
+       kfree(ah->bank6Temp);
+       ah->bank6Temp = NULL;
 }
 
 bool ath9k_hw_init_rf(struct ath_hw *ah, int *status)