* [ath9k-devel] [PATCH] ath10k: use config_enabled() for CONFIG_PM_SLEEP
@ 2013-04-22 12:27 Bartosz Markowski
2013-04-23 7:25 ` Kalle Valo
0 siblings, 1 reply; 3+ messages in thread
From: Bartosz Markowski @ 2013-04-22 12:27 UTC (permalink / raw)
To: ath9k-devel
Make use of config_enabled() check insted of raw #ifdef's
within function bodies when checking CONFIG_PM_SLEEP option.
Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
---
drivers/net/wireless/ath/ath10k/core.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
index b3c1e45..62f93d1 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -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:
--
1.7.10
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [ath9k-devel] [PATCH] ath10k: use config_enabled() for CONFIG_PM_SLEEP
2013-04-22 12:27 [ath9k-devel] [PATCH] ath10k: use config_enabled() for CONFIG_PM_SLEEP Bartosz Markowski
@ 2013-04-23 7:25 ` Kalle Valo
2013-04-23 7:28 ` Markowski Bartosz
0 siblings, 1 reply; 3+ messages in thread
From: Kalle Valo @ 2013-04-23 7:25 UTC (permalink / raw)
To: ath9k-devel
Bartosz Markowski <bartosz.markowski@tieto.com> writes:
> Make use of config_enabled() check insted of raw #ifdef's
> within function bodies when checking CONFIG_PM_SLEEP option.
>
> Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
[...]
> @@ -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);
> + }
[...]
> @@ -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?
--
Kalle Valo
^ permalink raw reply [flat|nested] 3+ messages in thread
* [ath9k-devel] [PATCH] ath10k: use config_enabled() for CONFIG_PM_SLEEP
2013-04-23 7:25 ` Kalle Valo
@ 2013-04-23 7:28 ` Markowski Bartosz
0 siblings, 0 replies; 3+ messages in thread
From: Markowski Bartosz @ 2013-04-23 7:28 UTC (permalink / raw)
To: ath9k-devel
On 23/04/13 09:25, Kalle Valo wrote:
> Bartosz Markowski <bartosz.markowski@tieto.com> writes:
>
>> Make use of config_enabled() check insted of raw #ifdef's
>> within function bodies when checking CONFIG_PM_SLEEP option.
>>
>> Signed-off-by: Bartosz Markowski <bartosz.markowski@tieto.com>
> [...]
>
>> @@ -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);
>> + }
> [...]
>
>> @@ -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?
>
That's sounds ok either. I will send a patch with removed #ifdefs.
Bartosz
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-04-23 7:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-22 12:27 [ath9k-devel] [PATCH] ath10k: use config_enabled() for CONFIG_PM_SLEEP Bartosz Markowski
2013-04-23 7:25 ` Kalle Valo
2013-04-23 7:28 ` Markowski Bartosz
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.