From mboxrd@z Thu Jan 1 00:00:00 1970 From: Markowski Bartosz Date: Tue, 23 Apr 2013 09:28:14 +0200 Subject: [ath9k-devel] [PATCH] ath10k: use config_enabled() for CONFIG_PM_SLEEP In-Reply-To: <87li89g13g.fsf@kamboji.qca.qualcomm.com> References: <1366633644-23023-1-git-send-email-bartosz.markowski@tieto.com> <87li89g13g.fsf@kamboji.qca.qualcomm.com> Message-ID: <5176380E.5050402@tieto.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: ath9k-devel@lists.ath9k.org On 23/04/13 09:25, Kalle Valo wrote: > Bartosz Markowski 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 > [...] > >> @@ -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