[lkml]   [2007]   [Apr]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
SubjectRe: checkpatch, a patch checking script.
 > Use WARN_ON & Recovery code rather than BUG() and BUG_ON()

BTW, I missed this before -- BUILD_BUG_ON() is actually far better
than WARN_ON(), I think.

Maybe something like this? (Although someone who knows perl probably
has a better way)

Don't tell people to change BUILD_BUG_ON() to WARN_ON().

Signed-off-by: Roland Dreier <>

--- 2007-04-27 20:30:34.000000000 -0700
+++ 2007-04-27 22:54:42.000000000 -0700
@@ -123,7 +123,7 @@
$warnings += search(qr/kernel_thread\(/, "Use kthread abstraction instead of kernel_thread()\n");
$warnings += search(qr/typedef/, "Do not add new typedefs.\n");
$warnings += search(qr/uint32_t/, "Incorrect type usage for kernel code. Use __u32 etc.\n");
- $warnings += search(qr/BUG(_ON)\(/, "Use WARN_ON & Recovery code rather than BUG() and BUG_ON()\n");
+ $warnings += search(qr/(?<!BUILD_)BUG(_ON)\(/, "Use WARN_ON & Recovery code rather than BUG() and BUG_ON()\n");

# pedantic: Noisy regexps that aren't really fatal.
if ($opt_pedantic) {
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at
 \ /
  Last update: 2007-04-28 08:01    [W:0.124 / U:3.352 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site