All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] __likely -> likely conversion
@ 2004-07-07 10:09 Hannes Reinecke
  0 siblings, 0 replies; only message in thread
From: Hannes Reinecke @ 2004-07-07 10:09 UTC (permalink / raw)
  To: linux-hotplug

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

Hi hpa,

the following patch corrects the usage of '__likely', which has been 
replaced by 'likely()' in recent kernels.
Plus it adds a missing include 'klibc/compiler.h' for sys/types.h as the 
bitops on S/390 insist on using 'likely'.

Please apply.

THX,

Hannes
-- 
Dr. Hannes Reinecke			hare@suse.de
SuSE Linux AG				S390 & zSeries
Maxfeldstraße 5				+49 911 74053 688
90409 Nürnberg				http://www.suse.de

[-- Attachment #2: klibc-0.148.likely_unlikely.patch --]
[-- Type: text/x-patch, Size: 1613 bytes --]

--- klibc-0.148/klibc/include/klibc/compiler.h.orig	2004-07-07 11:50:33.894529463 +0200
+++ klibc-0.148/klibc/include/klibc/compiler.h	2004-07-07 11:51:19.393603586 +0200
@@ -94,11 +94,11 @@
 
 /* likely/unlikely */
 #if defined(__GNUC__) && (__GNUC_MAJOR__ > 2 || (__GNUC_MAJOR__ == 2 && __GNUC_MINOR__ >= 95))
-# define __likely(x)   __builtin_expect((x), 1)
-# define __unlikely(x) __builtin_expect((x), 0)
+# define likely(x)   __builtin_expect((x), 1)
+# define unlikely(x) __builtin_expect((x), 0)
 #else
-# define __likely(x)   (x)
-# define __unlikely(x) (x)
+# define likely(x)   (x)
+# define unlikely(x) (x)
 #endif
 
 /* Possibly unused function */
--- klibc-0.148/klibc/getpagesize.c.orig	2004-07-07 11:56:04.315961696 +0200
+++ klibc-0.148/klibc/getpagesize.c	2004-07-07 11:56:31.849163813 +0200
@@ -13,7 +13,7 @@
   struct sysinfo si;
   int rv;
 
-  if ( __likely(page_size) )
+  if ( likely(page_size) )
     return page_size;
 
   rv = sysinfo(&si);
--- klibc-0.148/klibc/getpageshift.c.orig	2004-07-07 11:56:12.820479732 +0200
+++ klibc-0.148/klibc/getpageshift.c	2004-07-07 11:56:41.817426728 +0200
@@ -13,7 +13,7 @@
   static int page_shift;
   int page_size;
 
-  if ( __likely(page_shift) )
+  if ( likely(page_shift) )
     return page_shift;
 
   page_size = getpagesize();
--- klibc-0.148/klibc/include/sys/types.h.orig	2004-07-07 11:59:00.005344115 +0200
+++ klibc-0.148/klibc/include/sys/types.h	2004-07-07 11:59:22.378444749 +0200
@@ -11,6 +11,7 @@
 #define _SSIZE_T
 typedef ptrdiff_t ssize_t;
 
+#include <klibc/compiler.h>
 #include <linux/posix_types.h>
 #include <asm/types.h>
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-07-07 10:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-07 10:09 [PATCH] __likely -> likely conversion Hannes Reinecke

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.