diff options
author | Johannes Berg <johannes.berg@intel.com> | 2013-06-12 03:56:51 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-06-13 06:05:50 -0400 |
commit | 51cd53ad120f33410c48fd0d696e6f6255c8e780 (patch) | |
tree | 9271622e696002e527d77f1460ec3da402596ed4 /drivers/net/wireless/iwlwifi/pcie | |
parent | 12dcf2c3325a8aa25e8634b7e8337aad6f9be9b7 (diff) |
iwlwifi: reduce debug ifdefs using the optimiser
Instead of using #ifdef CONFIG_IWLWIFI_DEBUG, remove the
iwlwifi_mod_params.debug_level variable completely and
make iwl_have_debug_level() always return false in the
non-debug case. This way, the optimiser will elide all
code for it automatically without having to add #ifdefs.
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/pcie')
-rw-r--r-- | drivers/net/wireless/iwlwifi/pcie/rx.c | 36 |
1 files changed, 10 insertions, 26 deletions
diff --git a/drivers/net/wireless/iwlwifi/pcie/rx.c b/drivers/net/wireless/iwlwifi/pcie/rx.c index 63ba21e51f8d..3688dc5ba1ac 100644 --- a/drivers/net/wireless/iwlwifi/pcie/rx.c +++ b/drivers/net/wireless/iwlwifi/pcie/rx.c | |||
@@ -802,9 +802,6 @@ irqreturn_t iwl_pcie_irq_handler(int irq, void *dev_id) | |||
802 | u32 handled = 0; | 802 | u32 handled = 0; |
803 | unsigned long flags; | 803 | unsigned long flags; |
804 | u32 i; | 804 | u32 i; |
805 | #ifdef CONFIG_IWLWIFI_DEBUG | ||
806 | u32 inta_mask; | ||
807 | #endif | ||
808 | 805 | ||
809 | lock_map_acquire(&trans->sync_cmd_lockdep_map); | 806 | lock_map_acquire(&trans->sync_cmd_lockdep_map); |
810 | 807 | ||
@@ -826,14 +823,9 @@ irqreturn_t iwl_pcie_irq_handler(int irq, void *dev_id) | |||
826 | 823 | ||
827 | inta = trans_pcie->inta; | 824 | inta = trans_pcie->inta; |
828 | 825 | ||
829 | #ifdef CONFIG_IWLWIFI_DEBUG | 826 | if (iwl_have_debug_level(IWL_DL_ISR)) |
830 | if (iwl_have_debug_level(IWL_DL_ISR)) { | ||
831 | /* just for debug */ | ||
832 | inta_mask = iwl_read32(trans, CSR_INT_MASK); | ||
833 | IWL_DEBUG_ISR(trans, "inta 0x%08x, enabled 0x%08x\n", | 827 | IWL_DEBUG_ISR(trans, "inta 0x%08x, enabled 0x%08x\n", |
834 | inta, inta_mask); | 828 | inta, iwl_read32(trans, CSR_INT_MASK)); |
835 | } | ||
836 | #endif | ||
837 | 829 | ||
838 | /* saved interrupt in inta variable now we can reset trans_pcie->inta */ | 830 | /* saved interrupt in inta variable now we can reset trans_pcie->inta */ |
839 | trans_pcie->inta = 0; | 831 | trans_pcie->inta = 0; |
@@ -855,12 +847,11 @@ irqreturn_t iwl_pcie_irq_handler(int irq, void *dev_id) | |||
855 | goto out; | 847 | goto out; |
856 | } | 848 | } |
857 | 849 | ||
858 | #ifdef CONFIG_IWLWIFI_DEBUG | ||
859 | if (iwl_have_debug_level(IWL_DL_ISR)) { | 850 | if (iwl_have_debug_level(IWL_DL_ISR)) { |
860 | /* NIC fires this, but we don't use it, redundant with WAKEUP */ | 851 | /* NIC fires this, but we don't use it, redundant with WAKEUP */ |
861 | if (inta & CSR_INT_BIT_SCD) { | 852 | if (inta & CSR_INT_BIT_SCD) { |
862 | IWL_DEBUG_ISR(trans, "Scheduler finished to transmit " | 853 | IWL_DEBUG_ISR(trans, |
863 | "the frame/frames.\n"); | 854 | "Scheduler finished to transmit the frame/frames.\n"); |
864 | isr_stats->sch++; | 855 | isr_stats->sch++; |
865 | } | 856 | } |
866 | 857 | ||
@@ -870,7 +861,7 @@ irqreturn_t iwl_pcie_irq_handler(int irq, void *dev_id) | |||
870 | isr_stats->alive++; | 861 | isr_stats->alive++; |
871 | } | 862 | } |
872 | } | 863 | } |
873 | #endif | 864 | |
874 | /* Safely ignore these bits for debug checks below */ | 865 | /* Safely ignore these bits for debug checks below */ |
875 | inta &= ~(CSR_INT_BIT_SCD | CSR_INT_BIT_ALIVE); | 866 | inta &= ~(CSR_INT_BIT_SCD | CSR_INT_BIT_ALIVE); |
876 | 867 | ||
@@ -1118,9 +1109,6 @@ static irqreturn_t iwl_pcie_isr(int irq, void *data) | |||
1118 | struct iwl_trans *trans = data; | 1109 | struct iwl_trans *trans = data; |
1119 | struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); | 1110 | struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans); |
1120 | u32 inta, inta_mask; | 1111 | u32 inta, inta_mask; |
1121 | #ifdef CONFIG_IWLWIFI_DEBUG | ||
1122 | u32 inta_fh; | ||
1123 | #endif | ||
1124 | 1112 | ||
1125 | lockdep_assert_held(&trans_pcie->irq_lock); | 1113 | lockdep_assert_held(&trans_pcie->irq_lock); |
1126 | 1114 | ||
@@ -1159,13 +1147,11 @@ static irqreturn_t iwl_pcie_isr(int irq, void *data) | |||
1159 | return IRQ_HANDLED; | 1147 | return IRQ_HANDLED; |
1160 | } | 1148 | } |
1161 | 1149 | ||
1162 | #ifdef CONFIG_IWLWIFI_DEBUG | 1150 | if (iwl_have_debug_level(IWL_DL_ISR)) |
1163 | if (iwl_have_debug_level(IWL_DL_ISR)) { | 1151 | IWL_DEBUG_ISR(trans, |
1164 | inta_fh = iwl_read32(trans, CSR_FH_INT_STATUS); | 1152 | "ISR inta 0x%08x, enabled 0x%08x, fh 0x%08x\n", |
1165 | IWL_DEBUG_ISR(trans, "ISR inta 0x%08x, enabled 0x%08x, " | 1153 | inta, inta_mask, |
1166 | "fh 0x%08x\n", inta, inta_mask, inta_fh); | 1154 | iwl_read32(trans, CSR_FH_INT_STATUS)); |
1167 | } | ||
1168 | #endif | ||
1169 | 1155 | ||
1170 | trans_pcie->inta |= inta; | 1156 | trans_pcie->inta |= inta; |
1171 | /* the thread will service interrupts and re-enable them */ | 1157 | /* the thread will service interrupts and re-enable them */ |
@@ -1272,11 +1258,9 @@ irqreturn_t iwl_pcie_isr_ict(int irq, void *data) | |||
1272 | inta = (0xff & val) | ((0xff00 & val) << 16); | 1258 | inta = (0xff & val) | ((0xff00 & val) << 16); |
1273 | IWL_DEBUG_ISR(trans, "ISR inta 0x%08x, enabled(sw) 0x%08x ict 0x%08x\n", | 1259 | IWL_DEBUG_ISR(trans, "ISR inta 0x%08x, enabled(sw) 0x%08x ict 0x%08x\n", |
1274 | inta, trans_pcie->inta_mask, val); | 1260 | inta, trans_pcie->inta_mask, val); |
1275 | #ifdef CONFIG_IWLWIFI_DEBUG | ||
1276 | if (iwl_have_debug_level(IWL_DL_ISR)) | 1261 | if (iwl_have_debug_level(IWL_DL_ISR)) |
1277 | IWL_DEBUG_ISR(trans, "enabled(hw) 0x%08x\n", | 1262 | IWL_DEBUG_ISR(trans, "enabled(hw) 0x%08x\n", |
1278 | iwl_read32(trans, CSR_INT_MASK)); | 1263 | iwl_read32(trans, CSR_INT_MASK)); |
1279 | #endif | ||
1280 | 1264 | ||
1281 | inta &= trans_pcie->inta_mask; | 1265 | inta &= trans_pcie->inta_mask; |
1282 | trans_pcie->inta |= inta; | 1266 | trans_pcie->inta |= inta; |