aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2013-05-06 19:50:13 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-05-12 08:16:22 -0400
commit8ee492d6595573a0d4be168ebda1c7ceb4ec509d (patch)
treea2edf603eedb8dd407cb51b862964029cdf6c6bb
parentb01235861b84c0f6107d3f9da189c9898fc3caaf (diff)
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>
-rw-r--r--include/linux/freezer.h58
1 files changed, 29 insertions, 29 deletions
diff --git a/include/linux/freezer.h b/include/linux/freezer.h
index c71337af9bbd..8430d4c51ece 100644
--- a/include/linux/freezer.h
+++ b/include/linux/freezer.h
@@ -159,46 +159,46 @@ static inline bool freezer_should_skip(struct task_struct *p)
159} 159}
160 160
161/* 161/*
162 * These macros are intended to be used whenever you want allow a sleeping 162 * These functions are intended to be used whenever you want allow a sleeping
163 * task to be frozen. Note that neither return any clear indication of 163 * task to be frozen. Note that neither return any clear indication of
164 * whether a freeze event happened while in this function. 164 * whether a freeze event happened while in this function.
165 */ 165 */
166 166
167/* Like schedule(), but should not block the freezer. */ 167/* Like schedule(), but should not block the freezer. */
168#define freezable_schedule() \ 168static inline void freezable_schedule(void)
169({ \ 169{
170 freezer_do_not_count(); \ 170 freezer_do_not_count();
171 schedule(); \ 171 schedule();
172 freezer_count(); \ 172 freezer_count();
173}) 173}
174 174
175/* DO NOT ADD ANY NEW CALLERS OF THIS FUNCTION */ 175/* DO NOT ADD ANY NEW CALLERS OF THIS FUNCTION */
176#define freezable_schedule_unsafe() \ 176static inline void freezable_schedule_unsafe(void)
177({ \ 177{
178 freezer_do_not_count(); \ 178 freezer_do_not_count();
179 schedule(); \ 179 schedule();
180 freezer_count_unsafe(); \ 180 freezer_count_unsafe();
181}) 181}
182 182
183/* Like schedule_timeout_killable(), but should not block the freezer. */ 183/* Like schedule_timeout_killable(), but should not block the freezer. */
184#define freezable_schedule_timeout_killable(timeout) \ 184static inline long freezable_schedule_timeout_killable(long timeout)
185({ \ 185{
186 long __retval; \ 186 long __retval;
187 freezer_do_not_count(); \ 187 freezer_do_not_count();
188 __retval = schedule_timeout_killable(timeout); \ 188 __retval = schedule_timeout_killable(timeout);
189 freezer_count(); \ 189 freezer_count();
190 __retval; \ 190 return __retval;
191}) 191}
192 192
193/* DO NOT ADD ANY NEW CALLERS OF THIS FUNCTION */ 193/* DO NOT ADD ANY NEW CALLERS OF THIS FUNCTION */
194#define freezable_schedule_timeout_killable_unsafe(timeout) \ 194static inline long freezable_schedule_timeout_killable_unsafe(long timeout)
195({ \ 195{
196 long __retval; \ 196 long __retval;
197 freezer_do_not_count(); \ 197 freezer_do_not_count();
198 __retval = schedule_timeout_killable(timeout); \ 198 __retval = schedule_timeout_killable(timeout);
199 freezer_count_unsafe(); \ 199 freezer_count_unsafe();
200 __retval; \ 200 return __retval;
201}) 201}
202 202
203/* 203/*
204 * Freezer-friendly wrappers around wait_event_interruptible(), 204 * Freezer-friendly wrappers around wait_event_interruptible(),