From: Rusty Russell <rusty@rustcorp.com.au>
To: linux-kernel@vger.kernel.org
Cc: torvalds@transmeta.com
Subject: [PATCH] BUG_ON() not arch-specific.
Date: Wed, 05 Dec 2001 18:24:40 +1100 [thread overview]
Message-ID: <E16BWQ4-00070r-00@wagner> (raw)
Hi all,
We only need one BUG_ON implementation, surely. Genericized
and moved to linux/kernel.h.
Cheers,
Rusty.
diff -urN -I \$.*\$ --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal linux-2.5.1-pre5/include/linux/kernel.h working-2.5.1-pre5-percpu/include/linux/kernel.h
--- linux-2.5.1-pre5/include/linux/kernel.h Wed Dec 5 16:49:14 2001
+++ working-2.5.1-pre5-percpu/include/linux/kernel.h Wed Dec 5 18:12:15 2001
@@ -176,4 +176,5 @@
char _f[20-2*sizeof(long)-sizeof(int)]; /* Padding: libc5 uses this.. */
};
+#define BUG_ON(condition) do { if (unlikely((condition)!=0)) BUG(); } while(0)
#endif
diff -urN -I \$.*\$ --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal linux-2.5.1-pre5/include/asm-alpha/page.h working-2.5.1-pre5-percpu/include/asm-alpha/page.h
--- linux-2.5.1-pre5/include/asm-alpha/page.h Tue Dec 4 17:17:27 2001
+++ working-2.5.1-pre5-percpu/include/asm-alpha/page.h Wed Dec 5 18:14:34 2001
@@ -67,18 +67,6 @@
#define PAGE_BUG(page) BUG()
-#define BUG_ON(condition) \
- do { \
- if (unlikely((long)(condition)))\
- BUG(); \
- } while (0)
-
-#define BUG_ON(condition) \
- do { \
- if (unlikely((int)(condition))) \
- BUG(); \
- } while (0)
-
/* Pure 2^n version of get_order */
extern __inline__ int get_order(unsigned long size)
{
diff -urN -I \$.*\$ --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal linux-2.5.1-pre5/include/asm-i386/page.h working-2.5.1-pre5-percpu/include/asm-i386/page.h
--- linux-2.5.1-pre5/include/asm-i386/page.h Tue Dec 4 17:17:27 2001
+++ working-2.5.1-pre5-percpu/include/asm-i386/page.h Wed Dec 5 18:06:31 2001
@@ -101,12 +101,6 @@
BUG(); \
} while (0)
-#define BUG_ON(condition) \
- do { \
- if (unlikely((int)(condition))) \
- BUG(); \
- } while (0)
-
/* Pure 2^n version of get_order */
static __inline__ int get_order(unsigned long size)
{
--
Premature optmztion is rt of all evl. --DK
next reply other threads:[~2001-12-05 7:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-12-05 7:24 Rusty Russell [this message]
2001-12-05 8:36 ` [PATCH] BUG_ON() not arch-specific Jens Axboe
2001-12-05 14:42 ` David Woodhouse
2001-12-08 23:56 ` Rusty Russell
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=E16BWQ4-00070r-00@wagner \
--to=rusty@rustcorp.com.au \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.com \
/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 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.