Skip to contentSkip to conversation

ipc/sem: explicitly inline check_restart

PATCH New [email protected] 1 participant 1 message Dec 14, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 54/114 ipc/sem: explicitly inline check_restart

From: Davidlohr Bueso <[email protected]>
Subject: ipc/sem: explicitly inline check_restart

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.

---

 ipc/sem.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
ipc/sem.c renamed from ipc/sem.c~ipc-sem-explicitly-inline-check_restart +1 -1
diff -puN ipc/sem.c~ipc-sem-explicitly-inline-check_restart ipc/sem.c
@@ -772,7 +772,7 @@ static void unlink_queue(struct sem_arra
  * 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))

_