All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ipcsem: remove superflous decrease variable from sys_semtimedop
@ 2005-05-22 17:37 Manfred Spraul
  0 siblings, 0 replies; only message in thread
From: Manfred Spraul @ 2005-05-22 17:37 UTC (permalink / raw)
  To: Andrew Morton; +Cc: patrick, rdunlap, Linux Kernel Mailing List

[-- Attachment #1: Type: text/plain, Size: 395 bytes --]

Hi Andrew,

Patrick noticed that the initial scan of the semaphore operations logs 
decrease and increase operations seperately, but then both cases are 
or'ed together and decrease is never used.
The attached patch removes the decrease parameter - it shrinks 
sys_semtimedop() by 56 bytes.
Could you add it to your tree?

Signed-Of-By: Manfred Spraul <manfred@colorfullife.com>

--
    Manfred

[-- Attachment #2: patch-ipcsem-nodecrease --]
[-- Type: text/plain, Size: 680 bytes --]

--- 2.6/ipc/sem.c	2005-05-16 20:03:40.000000000 +0200
+++ build-2.6/ipc/sem.c	2005-05-22 09:23:00.000000000 +0200
@@ -1054,7 +1054,7 @@
 	struct sembuf fast_sops[SEMOPM_FAST];
 	struct sembuf* sops = fast_sops, *sop;
 	struct sem_undo *un;
-	int undos = 0, decrease = 0, alter = 0, max;
+	int undos = 0, alter = 0, max;
 	struct sem_queue queue;
 	unsigned long jiffies_left = 0;
 
@@ -1089,13 +1089,10 @@
 		if (sop->sem_num >= max)
 			max = sop->sem_num;
 		if (sop->sem_flg & SEM_UNDO)
-			undos++;
-		if (sop->sem_op < 0)
-			decrease = 1;
-		if (sop->sem_op > 0)
+			undos = 1;
+		if (sop->sem_op != 0)
 			alter = 1;
 	}
-	alter |= decrease;
 
 retry_undos:
 	if (undos) {

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-05-22 17:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-22 17:37 [PATCH] ipcsem: remove superflous decrease variable from sys_semtimedop Manfred Spraul

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.