freezer: convert freezable helpers to static inline where possible

Some of the freezable helpers have to be macros because their
condition argument needs to get evaluated every time through
the wait loop.  Convert the others to static inline to make
future changes easier.

Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Colin Cross <ccross@android.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
Colin Cross
2013-05-06 23:50:13 +00:00
committed by Rafael J. Wysocki
parent b01235861b
commit 8ee492d659

View File

@ -159,46 +159,46 @@ static inline bool freezer_should_skip(struct task_struct *p)
} }
/* /*
* These macros are intended to be used whenever you want allow a sleeping * These functions are intended to be used whenever you want allow a sleeping
* task to be frozen. Note that neither return any clear indication of * task to be frozen. Note that neither return any clear indication of
* whether a freeze event happened while in this function. * whether a freeze event happened while in this function.
*/ */
/* Like schedule(), but should not block the freezer. */ /* Like schedule(), but should not block the freezer. */
#define freezable_schedule() \ static inline void freezable_schedule(void)
({ \ {
freezer_do_not_count(); \ freezer_do_not_count();
schedule(); \ schedule();
freezer_count(); \ freezer_count();
}) }
/* DO NOT ADD ANY NEW CALLERS OF THIS FUNCTION */ /* DO NOT ADD ANY NEW CALLERS OF THIS FUNCTION */
#define freezable_schedule_unsafe() \ static inline void freezable_schedule_unsafe(void)
({ \ {
freezer_do_not_count(); \ freezer_do_not_count();
schedule(); \ schedule();
freezer_count_unsafe(); \ freezer_count_unsafe();
}) }
/* Like schedule_timeout_killable(), but should not block the freezer. */ /* Like schedule_timeout_killable(), but should not block the freezer. */
#define freezable_schedule_timeout_killable(timeout) \ static inline long freezable_schedule_timeout_killable(long timeout)
({ \ {
long __retval; \ long __retval;
freezer_do_not_count(); \ freezer_do_not_count();
__retval = schedule_timeout_killable(timeout); \ __retval = schedule_timeout_killable(timeout);
freezer_count(); \ freezer_count();
__retval; \ return __retval;
}) }
/* DO NOT ADD ANY NEW CALLERS OF THIS FUNCTION */ /* DO NOT ADD ANY NEW CALLERS OF THIS FUNCTION */
#define freezable_schedule_timeout_killable_unsafe(timeout) \ static inline long freezable_schedule_timeout_killable_unsafe(long timeout)
({ \ {
long __retval; \ long __retval;
freezer_do_not_count(); \ freezer_do_not_count();
__retval = schedule_timeout_killable(timeout); \ __retval = schedule_timeout_killable(timeout);
freezer_count_unsafe(); \ freezer_count_unsafe();
__retval; \ return __retval;
}) }
/* /*
* Freezer-friendly wrappers around wait_event_interruptible(), * Freezer-friendly wrappers around wait_event_interruptible(),