lkml.org 
[lkml]   [2006]   [Oct]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Fix WARN_ON / WARN_ON_ONCE regression
Steven Rostedt wrote:
> http://marc.theaimsgroup.com/?l=linux-kernel&m=114935833125957&w=2
>
> That was different, since we were putting a likely condition in an
> unlikely(). But I still don't see why we would ever want to test
> __warn_once before the condition, since it doesn't save on anything and
> just adds extra work. I don't see the savings.
>

Also, in that thread you cite (__warn_once && (condition)) is flat-out
wrong, because condition may have a side-effect. There are plenty of
places in the code which use BUG_ON or WARN_ON as a general error
checking mechanism which expect the condition to be always evaluated
once; WARN_ON_ONCE should be the same.

Personally I think it is poor style, but there you are.

J
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-10-08 02:43    [W:0.397 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site