Commit b78755abcdf1d7667c51580a3783e16e981ed926

Authored by Manfred Spraul
Committed by Linus Torvalds
1 parent 0030cbf06c

[PATCH] ipcsem: remove superflous decrease variable from sys_semtimedop

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 <manfred@colorfullife.com>

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

Showing 1 changed file with 3 additions and 6 deletions Side-by-side Diff

... ... @@ -1054,7 +1054,7 @@
1054 1054 struct sembuf fast_sops[SEMOPM_FAST];
1055 1055 struct sembuf* sops = fast_sops, *sop;
1056 1056 struct sem_undo *un;
1057   - int undos = 0, decrease = 0, alter = 0, max;
  1057 + int undos = 0, alter = 0, max;
1058 1058 struct sem_queue queue;
1059 1059 unsigned long jiffies_left = 0;
1060 1060  
1061 1061  
... ... @@ -1089,13 +1089,10 @@
1089 1089 if (sop->sem_num >= max)
1090 1090 max = sop->sem_num;
1091 1091 if (sop->sem_flg & SEM_UNDO)
1092   - undos++;
1093   - if (sop->sem_op < 0)
1094   - decrease = 1;
1095   - if (sop->sem_op > 0)
  1092 + undos = 1;
  1093 + if (sop->sem_op != 0)
1096 1094 alter = 1;
1097 1095 }
1098   - alter |= decrease;
1099 1096  
1100 1097 retry_undos:
1101 1098 if (undos) {