From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934112AbcIRTMr (ORCPT ); Sun, 18 Sep 2016 15:12:47 -0400 Received: from smtp2.provo.novell.com ([137.65.250.81]:39302 "EHLO smtp2.provo.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1763669AbcIRTMP (ORCPT ); Sun, 18 Sep 2016 15:12:15 -0400 From: Davidlohr Bueso To: akpm@linux-foundation.org Cc: manfred@colorfullife.com, dave@stgolabs.net, linux-kernel@vger.kernel.org, Davidlohr Bueso Subject: [PATCH 4/5] ipc/sem: explicitly inline check_restart Date: Sun, 18 Sep 2016 12:11:35 -0700 Message-Id: <1474225896-10066-5-git-send-email-dave@stgolabs.net> X-Mailer: git-send-email 2.6.6 In-Reply-To: <1474225896-10066-1-git-send-email-dave@stgolabs.net> References: <1474225896-10066-1-git-send-email-dave@stgolabs.net> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The compiler already does this, but make it explicit. This helper is really small and also used in update_queue's main loop, which is O(N^2) scanning. Inline and avoid the function overhead. Signed-off-by: Davidlohr Bueso --- ipc/sem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ipc/sem.c b/ipc/sem.c index e868b5933ff8..89adba51e85f 100644 --- a/ipc/sem.c +++ b/ipc/sem.c @@ -771,7 +771,7 @@ static void unlink_queue(struct sem_array *sma, struct sem_queue *q) * modified the array. * Note that wait-for-zero operations are handled without restart. */ -static int check_restart(struct sem_array *sma, struct sem_queue *q) +static inline int check_restart(struct sem_array *sma, struct sem_queue *q) { /* pending complex alter operations are too difficult to analyse */ if (!list_empty(&sma->pending_alter)) -- 2.6.6