Skip to content

Commit

Permalink
[PATCH] ipcsem: remove superflous decrease variable from sys_semtimedop
Browse files Browse the repository at this point in the history
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.

Signed-Of-By: Manfred Spraul <[email protected]>

Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
manfred-colorfu authored and Linus Torvalds committed Jun 23, 2005
1 parent 0030cbf commit b78755a
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions ipc/sem.c
Original file line number Diff line number Diff line change
Expand Up @@ -1054,7 +1054,7 @@ asmlinkage long sys_semtimedop(int semid, struct sembuf __user *tsops,
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;

Expand Down Expand Up @@ -1089,13 +1089,10 @@ asmlinkage long sys_semtimedop(int semid, struct sembuf __user *tsops,
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) {
Expand Down

0 comments on commit b78755a

Please sign in to comment.