All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rob Landley <rlandley@parallels.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: trivial@kernel.org, linux-net@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-embedded@vger.kernel.org
Subject: [PATCH] Move an assert under DEBUG_KERNEL. (attempt 2)
Date: Mon, 10 Jan 2011 02:35:33 -0600	[thread overview]
Message-ID: <4D2AC4D5.5070503@parallels.com> (raw)
In-Reply-To: <20110106154120.b69118c9.akpm@linux-foundation.org>

On 01/06/2011 05:41 PM, Andrew Morton wrote:
> Probably a worthwhile thing to do, IMO.  If there's some net-specific
> CONFIG_DEBUG_ setting then that wold be a better thing to use.
> 
> However the patch was a) wordwrapped, b) space-stuffed and c) not cc'ed
> to the networking list.  So its prospects are dim.

Ok, either I've beaten thunderbird into submission, or I'll be submitting a patch to Documentation/email-clients.txt.  (Whether or not I need to find a different smtp server to send this through remains an open question.)

(Confirming: I looked for a more specific DEBUG symbol, but couldn't find one.  I can add one, but this seems a bit small to have its own symbol, and DEBUG_KERNEL is already used in a few *.c files.)

From: Rob Landley <rlandley@parallels.com>

Move an assert under DEBUG_KERNEL.  (Minor cleanup to save a few bytes.)

Signed-off-by: Rob Landley <rlandley@parallels.com>
---

 include/linux/rtnetlink.h |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index bbad657..28c4025 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -782,6 +782,7 @@ extern struct netdev_queue *dev_ingress_queue_create(struct net_device *dev);
 extern void rtnetlink_init(void);
 extern void __rtnl_unlock(void);
 
+#ifdef CONFIG_DEBUG_KERNEL
 #define ASSERT_RTNL() do { \
 	if (unlikely(!rtnl_is_locked())) { \
 		printk(KERN_ERR "RTNL: assertion failed at %s (%d)\n", \
@@ -789,6 +790,9 @@ extern void __rtnl_unlock(void);
 		dump_stack(); \
 	} \
 } while(0)
+#else
+#define ASSERT_RTNL()
+#endif
 
 static inline u32 rtm_get_table(struct rtattr **rta, u8 table)
 {

WARNING: multiple messages have this Message-ID (diff)
From: Rob Landley <rlandley@parallels.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: <trivial@kernel.org>, <linux-net@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <linux-embedded@vger.kernel.org>
Subject: [PATCH] Move an assert under DEBUG_KERNEL. (attempt 2)
Date: Mon, 10 Jan 2011 02:35:33 -0600	[thread overview]
Message-ID: <4D2AC4D5.5070503@parallels.com> (raw)
In-Reply-To: <20110106154120.b69118c9.akpm@linux-foundation.org>

On 01/06/2011 05:41 PM, Andrew Morton wrote:
> Probably a worthwhile thing to do, IMO.  If there's some net-specific
> CONFIG_DEBUG_ setting then that wold be a better thing to use.
> 
> However the patch was a) wordwrapped, b) space-stuffed and c) not cc'ed
> to the networking list.  So its prospects are dim.

Ok, either I've beaten thunderbird into submission, or I'll be submitting a patch to Documentation/email-clients.txt.  (Whether or not I need to find a different smtp server to send this through remains an open question.)

(Confirming: I looked for a more specific DEBUG symbol, but couldn't find one.  I can add one, but this seems a bit small to have its own symbol, and DEBUG_KERNEL is already used in a few *.c files.)

From: Rob Landley <rlandley@parallels.com>

Move an assert under DEBUG_KERNEL.  (Minor cleanup to save a few bytes.)

Signed-off-by: Rob Landley <rlandley@parallels.com>
---

 include/linux/rtnetlink.h |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index bbad657..28c4025 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -782,6 +782,7 @@ extern struct netdev_queue *dev_ingress_queue_create(struct net_device *dev);
 extern void rtnetlink_init(void);
 extern void __rtnl_unlock(void);
 
+#ifdef CONFIG_DEBUG_KERNEL
 #define ASSERT_RTNL() do { \
 	if (unlikely(!rtnl_is_locked())) { \
 		printk(KERN_ERR "RTNL: assertion failed at %s (%d)\n", \
@@ -789,6 +790,9 @@ extern void __rtnl_unlock(void);
 		dump_stack(); \
 	} \
 } while(0)
+#else
+#define ASSERT_RTNL()
+#endif
 
 static inline u32 rtm_get_table(struct rtattr **rta, u8 table)
 {

  parent reply	other threads:[~2011-01-10  8:35 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-06  8:13 [PATCH] Move an assert under DEBUG_KERNEL Rob Landley
2011-01-06  8:13 ` Rob Landley
2011-01-06 23:41 ` Andrew Morton
2011-01-06 23:41   ` Andrew Morton
2011-01-07  9:44   ` Rob Landley
2011-01-07  9:44     ` Rob Landley
2011-01-10  8:35   ` Rob Landley [this message]
2011-01-10  8:35     ` [PATCH] Move an assert under DEBUG_KERNEL. (attempt 2) Rob Landley
2011-01-10 17:15     ` Randy Dunlap
2011-01-10 17:15       ` Randy Dunlap
2011-01-11  4:27       ` [PATCH] update Thunderbird docs with wordwrap plugin Rob Landley
2011-01-10 17:19     ` [PATCH] Move an assert under DEBUG_KERNEL. (attempt 2) Randy Dunlap
2011-01-10 17:19       ` 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=4D2AC4D5.5070503@parallels.com \
    --to=rlandley@parallels.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-embedded@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-net@vger.kernel.org \
    --cc=trivial@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 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.