Skip to contentSkip to conversation

ath10k: use config_enabled() for CONFIG_PM_SLEEP

PATCH New Bartosz Markowski 2 participants 3 messages Apr 22, 2013 – Apr 23, 2013 Qualcomm Atheros ATH10K wireless driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ath10k: use config_enabled() for CONFIG_PM_SLEEP

Make use of config_enabled() check insted of raw #ifdef's within function bodies when checking CONFIG_PM_SLEEP option.

---
 drivers/net/wireless/ath/ath10k/core.c |   14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/net/wireless/ath/ath10k/core.c +7 -7
index b3c1e45..62f93d1 100644
@@ -72,10 +72,10 @@ static void ath10k_send_suspend_complete(struct ath10k *ar)
 {
 	ath10k_dbg(ATH10K_DBG_CORE, "%s\n", __func__);
 
-#if defined(CONFIG_PM_SLEEP)
-	ar->is_target_paused = true;
-	wake_up(&ar->event_queue);
-#endif
+	if(config_enabled(CONFIG_PM_SLEEP)) {
+		ar->is_target_paused = true;
+		wake_up(&ar->event_queue);
+	}
 }
 
 static int ath10k_check_fw_version(struct ath10k *ar)
@@ -468,9 +468,9 @@ struct ath10k *ath10k_core_create(void *hif_priv, struct device *dev,
 	INIT_WORK(&ar->offchan_tx_work, ath10k_offchan_tx_work);
 	skb_queue_head_init(&ar->offchan_tx_queue);
 
-#if defined(CONFIG_PM_SLEEP)
-	init_waitqueue_head(&ar->event_queue);
-#endif
+	if (config_enabled(CONFIG_PM_SLEEP))
+		init_waitqueue_head(&ar->event_queue);
+
 	return ar;
 
 err_wq:
Signature · 1 line
1.7.10
#1 lore raw

PATCH 1/1 ath10k: use config_enabled() for CONFIG_PM_SLEEP

Quoted 4 lines · Bartosz Markowski

Make use of config_enabled() check insted of raw #ifdef's within function bodies when checking CONFIG_PM_SLEEP option.

[...]

Quoted 12 lines
drivers/net/wireless/ath/ath10k/core.c +4 -4
@@ -72,10 +72,10 @@ static void ath10k_send_suspend_complete(struct ath10k *ar)
 {
 	ath10k_dbg(ATH10K_DBG_CORE, "%s\n", __func__);
 
-#if defined(CONFIG_PM_SLEEP)
-	ar->is_target_paused = true;
-	wake_up(&ar->event_queue);
-#endif
+	if(config_enabled(CONFIG_PM_SLEEP)) {
+		ar->is_target_paused = true;
+		wake_up(&ar->event_queue);
+	}

[...]

drivers/net/wireless/ath/ath10k/core.c struct ath10k *ath10k_core_create(void *hif_priv, struct device *dev, · line 473

Quoted 10 lines
drivers/net/wireless/ath/ath10k/core.c +3 -3
@@ -468,9 +468,9 @@ struct ath10k *ath10k_core_create(void *hif_priv, struct device *dev,
 	INIT_WORK(&ar->offchan_tx_work, ath10k_offchan_tx_work);
 	skb_queue_head_init(&ar->offchan_tx_queue);
 
-#if defined(CONFIG_PM_SLEEP)
-	init_waitqueue_head(&ar->event_queue);
-#endif
+	if (config_enabled(CONFIG_PM_SLEEP))
+		init_waitqueue_head(&ar->event_queue);
+

Do we really need config_enabled() here? To keep things simple what if we just remove the ifdefs and let that code run even if CONFIG_PM_SLEEP is disabled?

The overhead from init_waitqueue_head() is meaningless and I doubt the wake_up() call makes any pratical difference either.

Thoughts?

Signature · 1 line
Kalle Valo
#2 lore raw

PATCH 1/1 ath10k: use config_enabled() for CONFIG_PM_SLEEP

Quoted 36 lines · Kalle Valo
Quoted 4 lines · Bartosz Markowski

Make use of config_enabled() check insted of raw #ifdef's within function bodies when checking CONFIG_PM_SLEEP option.

[...]

Quoted 12 lines
drivers/net/wireless/ath/ath10k/core.c +4 -4
@@ -72,10 +72,10 @@ static void ath10k_send_suspend_complete(struct ath10k *ar)
  {
  	ath10k_dbg(ATH10K_DBG_CORE, "%s\n", __func__);
 
-#if defined(CONFIG_PM_SLEEP)
-	ar->is_target_paused = true;
-	wake_up(&ar->event_queue);
-#endif
+	if(config_enabled(CONFIG_PM_SLEEP)) {
+		ar->is_target_paused = true;
+		wake_up(&ar->event_queue);
+	}

[...]

drivers/net/wireless/ath/ath10k/core.c struct ath10k *ath10k_core_create(void *hif_priv, struct device *dev, · line 473

Quoted 10 lines
drivers/net/wireless/ath/ath10k/core.c +3 -3
@@ -468,9 +468,9 @@ struct ath10k *ath10k_core_create(void *hif_priv, struct device *dev,
  	INIT_WORK(&ar->offchan_tx_work, ath10k_offchan_tx_work);
  	skb_queue_head_init(&ar->offchan_tx_queue);
 
-#if defined(CONFIG_PM_SLEEP)
-	init_waitqueue_head(&ar->event_queue);
-#endif
+	if (config_enabled(CONFIG_PM_SLEEP))
+		init_waitqueue_head(&ar->event_queue);
+

Do we really need config_enabled() here? To keep things simple what if we just remove the ifdefs and let that code run even if CONFIG_PM_SLEEP is disabled?

Quoted 5 lines

The overhead from init_waitqueue_head() is meaningless and I doubt the wake_up() call makes any pratical difference either.

Thoughts?

That's sounds ok either. I will send a patch with removed #ifdefs.

Bartosz