From: Hannes Reinecke <hare@suse.de>
To: linux-hotplug@vger.kernel.org
Subject: [PATCH] __likely -> likely conversion
Date: Wed, 07 Jul 2004 10:09:53 +0000 [thread overview]
Message-ID: <40EBCBF1.5050407@suse.de> (raw)
[-- 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>
reply other threads:[~2004-07-07 10:09 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=40EBCBF1.5050407@suse.de \
--to=hare@suse.de \
--cc=linux-hotplug@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).