linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Manik Raina <manik@cisco.com>
To: linux-kernel@vger.kernel.org
Subject: [PATCH]: (off 2.5.22) replacing __builtin_expect with unlikely in Alpha  headers
Date: Wed, 19 Jun 2002 14:39:36 +0530	[thread overview]
Message-ID: <3D104A50.24C00206@cisco.com> (raw)

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


    This fix should remove __builtin_expect () and replace it with
unlikely ()  in include/asm-alpha/rwsem.h
    This should be cool since rwsem.h already includes
include/linux/compiler.h

    Files changed :

    include/asm-alpha/rwsem.h



[-- Attachment #2: a --]
[-- Type: text/plain, Size: 1832 bytes --]

diff -u -U 6 -r include/asm-alpha/rwsem.h /home/manik/linux-2.5.22/include/asm-alpha/rwsem.h
--- include/asm-alpha/rwsem.h	Mon Jun 17 08:01:35 2002
+++ /home/manik/linux-2.5.22/include/asm-alpha/rwsem.h	Wed Jun 19 14:25:03 2002
@@ -80,13 +80,13 @@
 	".subsection 2\n"
 	"2:	br	1b\n"
 	".previous"
 	:"=&r" (oldcount), "=m" (sem->count), "=&r" (temp)
 	:"Ir" (RWSEM_ACTIVE_READ_BIAS), "m" (sem->count) : "memory");
 #endif
-	if (__builtin_expect(oldcount < 0, 0))
+	if (unlikely(oldcount < 0))
 		rwsem_down_read_failed(sem);
 }
 
 static inline void __down_write(struct rw_semaphore *sem)
 {
 	long oldcount;
@@ -104,13 +104,13 @@
 	".subsection 2\n"
 	"2:	br	1b\n"
 	".previous"
 	:"=&r" (oldcount), "=m" (sem->count), "=&r" (temp)
 	:"Ir" (RWSEM_ACTIVE_WRITE_BIAS), "m" (sem->count) : "memory");
 #endif
-	if (__builtin_expect(oldcount, 0))
+	if (unlikely(oldcount))
 		rwsem_down_write_failed(sem);
 }
 
 static inline void __up_read(struct rw_semaphore *sem)
 {
 	long oldcount;
@@ -128,13 +128,13 @@
 	".subsection 2\n"
 	"2:	br	1b\n"
 	".previous"
 	:"=&r" (oldcount), "=m" (sem->count), "=&r" (temp)
 	:"Ir" (RWSEM_ACTIVE_READ_BIAS), "m" (sem->count) : "memory");
 #endif
-	if (__builtin_expect(oldcount < 0, 0)) 
+	if (unlikely(oldcount < 0)) 
 		if ((int)oldcount - RWSEM_ACTIVE_READ_BIAS == 0)
 			rwsem_wake(sem);
 }
 
 static inline void __up_write(struct rw_semaphore *sem)
 {
@@ -154,13 +154,13 @@
 	".subsection 2\n"
 	"2:	br	1b\n"
 	".previous"
 	:"=&r" (count), "=m" (sem->count), "=&r" (temp)
 	:"Ir" (RWSEM_ACTIVE_WRITE_BIAS), "m" (sem->count) : "memory");
 #endif
-	if (__builtin_expect(count, 0))
+	if (unlikely(count, 0))
 		if ((int)count == 0)
 			rwsem_wake(sem);
 }
 
 static inline void rwsem_atomic_add(long val, struct rw_semaphore *sem)
 {
Only in /home/manik/linux-2.5.22/include/asm-alpha/: rwsem.h~

             reply	other threads:[~2002-06-19  9:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-19  9:09 Manik Raina [this message]
2002-06-19  9:18 ` [PATCH]: (off 2.5.22) replacing __builtin_expect with unlikely in Alpha headers Adrian Bunk
     [not found] <0C01A29FBAE24448A792F5C68F5EA47D29E3F6@nasdaq.ms.ensim.com>
2002-06-19  9:15 ` Paul Menage

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=3D104A50.24C00206@cisco.com \
    --to=manik@cisco.com \
    --cc=linux-kernel@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).