public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH -mm] do not check condition twice in WARN_ON_SECS
@ 2008-03-12  1:09 Dave Young
  2008-03-12 13:47 ` Johannes Weiner
  0 siblings, 1 reply; 4+ messages in thread
From: Dave Young @ 2008-03-12  1:09 UTC (permalink / raw)
  To: akpm; +Cc: linux-kernel, Marcin Slusarz, paulmck

Don't check condition twice, change WARN_ON(condition) to WARN_ON(1)
Thanks Marcin Slusarz <marcin.slusarz@gmail.com> for pointing out

Signed-off-by: Dave Young <hidave.darkstar@gmail.com>

---
include/asm-generic/bug.h |    3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff -upr linux/include/asm-generic/bug.h linux.new/include/asm-generic/bug.h
--- linux/include/asm-generic/bug.h	2008-03-12 08:45:08.000000000 +0800
+++ linux.new/include/asm-generic/bug.h	2008-03-12 09:04:07.000000000 +0800
@@ -80,7 +80,8 @@ extern void warn_on_slowpath(const char 
 	int __ret_warn_on = !!(condition);			\
 	if (unlikely(__ret_warn_on))				\
 		if (__ratelimit(secs * HZ, 1))			\
-			WARN_ON(condition);			\
+			WARN_ON(1);				\
+	unlikely(__ret_warn_on);				\
 })
 
 #ifdef CONFIG_SMP

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

end of thread, other threads:[~2008-03-13  4:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-12  1:09 [PATCH -mm] do not check condition twice in WARN_ON_SECS Dave Young
2008-03-12 13:47 ` Johannes Weiner
2008-03-13  0:44   ` Dave Young
2008-03-13  4:47   ` Linus Torvalds

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