public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Move an assert under DEBUG_KERNEL.
@ 2011-01-06  8:13 Rob Landley
  2011-01-06 23:41 ` Andrew Morton
  0 siblings, 1 reply; 8+ messages in thread
From: Rob Landley @ 2011-01-06  8:13 UTC (permalink / raw)
  To: trivial, linux-kernel, linux-embedded

From: Rob Landley <rlandley@parallels.com>

Move an assert under DEBUG_KERNEL.

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

Saves about 3k from x86-64 defconfig according to scripts/bloat-o-meter.

  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)
  {

^ permalink raw reply related	[flat|nested] 8+ messages in thread
* [PATCH] Move an assert under DEBUG_KERNEL.
@ 2011-03-09 21:37 Rob Landley
  0 siblings, 0 replies; 8+ messages in thread
From: Rob Landley @ 2011-03-09 21:37 UTC (permalink / raw)
  To: LKML
  Cc: David S. Miller, Eric Dumazet, Patrick McHardy, Andy Whitcroft,
	Andrew Morton

From: Rob Landley <rlandley@parallels.com>

Move an assert under DEBUG_KERNEL.  (Minor cleanup, saves about 3k for me.)

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

Note: I looked for a better config symbol than DEBUG_KERNEL but there
isn't currently a relevant DEBUG_NET variant and this doesn't seem
big enough to add one.  DEBUG_KERNEL is already used directly in
powerpc, parisc, and blackfin anyway.

 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)
 {

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-03-09 21:37 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-06  8:13 [PATCH] Move an assert under DEBUG_KERNEL Rob Landley
2011-01-06 23:41 ` Andrew Morton
2011-01-07  9:44   ` Rob Landley
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-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
  -- strict thread matches above, loose matches on Subject: below --
2011-03-09 21:37 [PATCH] Move an assert under DEBUG_KERNEL Rob Landley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox