mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH]: (off 2.5.22) replacing __builtin_expect with unlikely in Alpha  headers
@ 2002-06-19  9:09 Manik Raina
  2002-06-19  9:18 ` Adrian Bunk
  0 siblings, 1 reply; 3+ messages in thread
From: Manik Raina @ 2002-06-19  9:09 UTC (permalink / raw)
  To: linux-kernel

[-- 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~

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH]: (off 2.5.22) replacing __builtin_expect with unlikely in Alpha headers
  2002-06-19  9:09 [PATCH]: (off 2.5.22) replacing __builtin_expect with unlikely in Alpha headers Manik Raina
@ 2002-06-19  9:18 ` Adrian Bunk
  0 siblings, 0 replies; 3+ messages in thread
From: Adrian Bunk @ 2002-06-19  9:18 UTC (permalink / raw)
  To: Manik Raina; +Cc: linux-kernel

On Wed, 19 Jun 2002, Manik Raina wrote:

>
>     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

The following part of your patch is obviously a typo:

-       if (__builtin_expect(count, 0))
+       if (unlikely(count, 0))
                          ^^^

cu
Adrian

-- 

You only think this is a free country. Like the US the UK spends a lot of
time explaining its a free country because its a police state.
								Alan Cox




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH]: (off 2.5.22) replacing __builtin_expect with unlikely in Alpha  headers
       [not found] <0C01A29FBAE24448A792F5C68F5EA47D29E3F6@nasdaq.ms.ensim.com>
@ 2002-06-19  9:15 ` Paul Menage
  0 siblings, 0 replies; 3+ messages in thread
From: Paul Menage @ 2002-06-19  9:15 UTC (permalink / raw)
  To: Manik Raina; +Cc: linux-kernel

In article <0C01A29FBAE24448A792F5C68F5EA47D29E3F6@nasdaq.ms.ensim.com>,
you write:
> 	:"=&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))
                          ^^^^ 

This should be

if (unlikely(count))

Paul


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-06-19  9:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-06-19  9:09 [PATCH]: (off 2.5.22) replacing __builtin_expect with unlikely in Alpha headers Manik Raina
2002-06-19  9:18 ` Adrian Bunk
     [not found] <0C01A29FBAE24448A792F5C68F5EA47D29E3F6@nasdaq.ms.ensim.com>
2002-06-19  9:15 ` Paul Menage

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®