From patchwork Mon May 6 23:50:13 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Cross X-Patchwork-Id: 2529041 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id DF79CDFB79 for ; Mon, 6 May 2013 23:54:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933100Ab3EFXyG (ORCPT ); Mon, 6 May 2013 19:54:06 -0400 Received: from mail-qe0-f74.google.com ([209.85.128.74]:64234 "EHLO mail-qe0-f74.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932423Ab3EFXua (ORCPT ); Mon, 6 May 2013 19:50:30 -0400 Received: by mail-qe0-f74.google.com with SMTP id 1so447667qec.3 for ; Mon, 06 May 2013 16:50:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=TdawKHo7T93s9D5dcvRVmjeWSto0Eg5ASXtwF+oSto0=; b=a8wqVheedGiDWYUsEcxLcE7j+GGzHbklsig2+YVlu/dbqHaLDRN5Sm2qJGIOJJEmVZ kRejdyh7eIidLl/lEGf53I3DmseyLUwEqpRVDwvg0RaM4e/8CaN3mWzG9wLz361TSoFz t+LnNyPe1hcUME+4rgc1waae79QzutRSoB/1I8K5kZM5QS88Sg01FCa3MFSGBZPj8Z7p N4B73K4inlBDxx6jB3wrRovQppch5tVkcwUE8QrRh8pu8N3qhhCFNeCD9BhhihGrvzCx qbYYi6vX98uP9DoFvt9rbAhvO0/S1iVWZ/eOLdRd6T0cokeNyr6roqTVZPfzlp8VgU9U 4e1w== X-Received: by 10.236.130.165 with SMTP id k25mr17119230yhi.14.1367884228088; Mon, 06 May 2013 16:50:28 -0700 (PDT) Received: from corp2gmr1-2.hot.corp.google.com (corp2gmr1-2.hot.corp.google.com [172.24.189.93]) by gmr-mx.google.com with ESMTPS id n23si2636342yhi.7.2013.05.06.16.50.28 for (version=TLSv1.1 cipher=AES128-SHA bits=128/128); Mon, 06 May 2013 16:50:28 -0700 (PDT) Received: from walnut.mtv.corp.google.com (walnut.mtv.corp.google.com [172.18.105.48]) by corp2gmr1-2.hot.corp.google.com (Postfix) with ESMTP id E55295A4005; Mon, 6 May 2013 16:50:27 -0700 (PDT) Received: by walnut.mtv.corp.google.com (Postfix, from userid 99897) id C6B881613FF; Mon, 6 May 2013 16:50:27 -0700 (PDT) From: Colin Cross To: linux-kernel@vger.kernel.org Cc: Pavel Machek , "Rafael J. Wysocki" , Peter Zijlstra , Ingo Molnar , Andrew Morton , Mandeep Singh Baines , Colin Cross , Oleg Nesterov , linux-nfs@vger.kernel.org, linux-pm@vger.kernel.org, netdev@vger.kernel.org, Linus Torvalds , Tejun Heo , Len Brown Subject: [PATCH v3 08/16] freezer: convert freezable helpers to static inline where possible Date: Mon, 6 May 2013 16:50:13 -0700 Message-Id: <1367884221-20462-9-git-send-email-ccross@android.com> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1367884221-20462-1-git-send-email-ccross@android.com> References: <1367884221-20462-1-git-send-email-ccross@android.com> X-Gm-Message-State: ALoCoQnadqDsOJY4uP2zq9B8OJ/uhYct5VrrwpkcfKHEpLaYhruEOgDjFUmxU4pB1SqLpT4ZaULsL/40R73ZTJvGpG4BULzP9/ByxoGLTmSD3l8RAETPAaivH2uKkVLCfttXrlQfZxkIXXIEAxWf6r3QyGUVfB+P2+FWsgGK2Cl4lF96sgkj8qvgCEIqOegnAoQ/gPE5PJUf Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org 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. Signed-off-by: Colin Cross --- include/linux/freezer.h | 58 ++++++++++++++++++++++++------------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/include/linux/freezer.h b/include/linux/freezer.h index c71337af..8430d4c5 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) } /* - * 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 * whether a freeze event happened while in this function. */ /* Like schedule(), but should not block the freezer. */ -#define freezable_schedule() \ -({ \ - freezer_do_not_count(); \ - schedule(); \ - freezer_count(); \ -}) +static inline void freezable_schedule(void) +{ + freezer_do_not_count(); + schedule(); + freezer_count(); +} /* DO NOT ADD ANY NEW CALLERS OF THIS FUNCTION */ -#define freezable_schedule_unsafe() \ -({ \ - freezer_do_not_count(); \ - schedule(); \ - freezer_count_unsafe(); \ -}) +static inline void freezable_schedule_unsafe(void) +{ + freezer_do_not_count(); + schedule(); + freezer_count_unsafe(); +} /* Like schedule_timeout_killable(), but should not block the freezer. */ -#define freezable_schedule_timeout_killable(timeout) \ -({ \ - long __retval; \ - freezer_do_not_count(); \ - __retval = schedule_timeout_killable(timeout); \ - freezer_count(); \ - __retval; \ -}) +static inline long freezable_schedule_timeout_killable(long timeout) +{ + long __retval; + freezer_do_not_count(); + __retval = schedule_timeout_killable(timeout); + freezer_count(); + return __retval; +} /* DO NOT ADD ANY NEW CALLERS OF THIS FUNCTION */ -#define freezable_schedule_timeout_killable_unsafe(timeout) \ -({ \ - long __retval; \ - freezer_do_not_count(); \ - __retval = schedule_timeout_killable(timeout); \ - freezer_count_unsafe(); \ - __retval; \ -}) +static inline long freezable_schedule_timeout_killable_unsafe(long timeout) +{ + long __retval; + freezer_do_not_count(); + __retval = schedule_timeout_killable(timeout); + freezer_count_unsafe(); + return __retval; +} /* * Freezer-friendly wrappers around wait_event_interruptible(),