public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Rolf Eike Beer <eike-kernel@sf-tec.de>
To: linux-kernel@vger.kernel.org
Cc: Linus Torvalds <torvalds@osdl.org>
Subject: [PATCH] if(foo) BUG() -> BUG_ON(foo) for include/rxrpc/
Date: Wed, 24 Sep 2003 12:33:09 +0200	[thread overview]
Message-ID: <200309241233.09877@bilbo.math.uni-mannheim.de> (raw)

Hi again,

some cosmetic changes. Some more will follow as replies to this one.

Eike

diff -aur linux-2.6.0-test5-bk6/include/rxrpc/call.h linux-2.6.0-test5-bk6-caliban/include/rxrpc/call.h
--- linux-2.6.0-test5-bk6/include/rxrpc/call.h	2003-09-11 10:18:33.000000000 +0200
+++ linux-2.6.0-test5-bk6-caliban/include/rxrpc/call.h	2003-09-11 10:26:39.000000000 +0200
@@ -187,8 +187,7 @@
 
 static inline void rxrpc_get_call(struct rxrpc_call *call)
 {
-	if (atomic_read(&call->usage)<=0)
-		BUG();
+	BUG_ON(atomic_read(&call->usage)<=0);
 	atomic_inc(&call->usage);
 	/*printk("rxrpc_get_call(%p{u=%d})\n",(C),atomic_read(&(C)->usage));*/
 }
diff -aur linux-2.6.0-test5-bk6/include/rxrpc/connection.h linux-2.6.0-test5-bk6-caliban/include/rxrpc/connection.h
--- linux-2.6.0-test5-bk6/include/rxrpc/connection.h	2003-09-11 10:18:33.000000000 +0200
+++ linux-2.6.0-test5-bk6-caliban/include/rxrpc/connection.h	2003-09-11 10:26:39.000000000 +0200
@@ -67,8 +67,7 @@
 
 static inline void rxrpc_get_connection(struct rxrpc_connection *conn)
 {
-	if (atomic_read(&conn->usage)<0)
-		BUG();
+	BUG_ON(atomic_read(&conn->usage)<0);
 	atomic_inc(&conn->usage);
 	//printk("rxrpc_get_conn(%p{u=%d})\n",conn,atomic_read(&conn->usage));
 }
diff -aur linux-2.6.0-test5-bk6/include/rxrpc/message.h linux-2.6.0-test5-bk6-caliban/include/rxrpc/message.h
--- linux-2.6.0-test5-bk6/include/rxrpc/message.h	2003-09-11 10:18:33.000000000 +0200
+++ linux-2.6.0-test5-bk6-caliban/include/rxrpc/message.h	2003-09-11 10:26:39.000000000 +0200
@@ -53,8 +53,7 @@
 extern void __rxrpc_put_message(struct rxrpc_message *msg);
 static inline void rxrpc_put_message(struct rxrpc_message *msg)
 {
-	if (atomic_read(&msg->usage)<=0)
-		BUG();
+	BUG_ON(atomic_read(&msg->usage)<=0);
 	if (atomic_dec_and_test(&msg->usage))
 		__rxrpc_put_message(msg);
 }
diff -aur linux-2.6.0-test5-bk6/include/rxrpc/peer.h linux-2.6.0-test5-bk6-caliban/include/rxrpc/peer.h
--- linux-2.6.0-test5-bk6/include/rxrpc/peer.h	2003-09-11 10:18:33.000000000 +0200
+++ linux-2.6.0-test5-bk6-caliban/include/rxrpc/peer.h	2003-09-11 10:26:39.000000000 +0200
@@ -72,8 +72,7 @@
 
 static inline void rxrpc_get_peer(struct rxrpc_peer *peer)
 {
-	if (atomic_read(&peer->usage)<0)
-		BUG();
+	BUG_ON(atomic_read(&peer->usage)<0);
 	atomic_inc(&peer->usage);
 	//printk("rxrpc_get_peer(%p{u=%d})\n",peer,atomic_read(&peer->usage));
 }
diff -aur linux-2.6.0-test5-bk6/include/rxrpc/transport.h linux-2.6.0-test5-bk6-caliban/include/rxrpc/transport.h
--- linux-2.6.0-test5-bk6/include/rxrpc/transport.h	2003-09-11 10:18:33.000000000 +0200
+++ linux-2.6.0-test5-bk6-caliban/include/rxrpc/transport.h	2003-09-11 10:27:28.000000000 +0200
@@ -85,8 +85,7 @@
 
 static inline void rxrpc_get_transport(struct rxrpc_transport *trans)
 {
-	if (atomic_read(&trans->usage) <= 0)
-		BUG();
+	BUG_ON(atomic_read(&trans->usage) <= 0);
 	atomic_inc(&trans->usage);
 	//printk("rxrpc_get_transport(%p{u=%d})\n",
 	//       trans, atomic_read(&trans->usage));

             reply	other threads:[~2003-09-24 10:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-24 10:33 Rolf Eike Beer [this message]
2003-09-24 10:34 ` [PATCH] if(foo) BUG() -> BUG_ON(foo) for include/net/ Rolf Eike Beer
2003-09-24 10:36   ` [PATCH] if(foo) BUG() -> BUG_ON(foo) for include/linux/ Rolf Eike Beer
2003-09-24 10:52     ` [PATCH] if(foo) BUG() -> BUG_ON(foo) for include/arch/ Rolf Eike Beer
2003-10-03 22:11       ` Randy.Dunlap

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=200309241233.09877@bilbo.math.uni-mannheim.de \
    --to=eike-kernel@sf-tec.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.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