public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Manfred Spraul <manfred@colorfullife.com>
To: Andrew Morton <akpm@osdl.org>
Cc: patrick@erdbeere.net, rdunlap@xenotime.net,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [PATCH] ipcsem: remove superflous decrease variable from sys_semtimedop
Date: Sun, 22 May 2005 19:37:46 +0200	[thread overview]
Message-ID: <4290C36A.7020006@colorfullife.com> (raw)

[-- 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) {

                 reply	other threads:[~2005-05-22 17:38 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4290C36A.7020006@colorfullife.com \
    --to=manfred@colorfullife.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patrick@erdbeere.net \
    --cc=rdunlap@xenotime.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox