lkml.org 
[lkml]   [2009]   [Sep]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] WARN_ONCE(): use bool for boolean flag
Daniel Walker escreveu:
> On Sun, 2009-09-27 at 10:53 -0300, Cesar Eduardo Barros wrote:
>> #define
>> WARN_ON_ONCE(condition) ({ \
>> - static int __warned; \
>> + static bool __warned; \
>> int __ret_warn_once = !!(condition); \
>
> Could __ret_warn_once be bool also ? It looks like just another
> conditional variable..

Yes, it could (as long as either it is converted back to int in the
return of the macro, or all users do not care about the macro's return
type). However, the justification used for the printk_once patch (and
this WARN_ONCE patch) does not apply directly anymore, since the code is
different (to start with, it is not a static variable).
--
Cesar Eduardo Barros
cesarb@cesarb.net
cesar.barros@gmail.com


\
 
 \ /
  Last update: 2009-09-27 18:01    [W:0.081 / U:0.036 seconds]
©2003-2014 Jasper Spaans. Advertise on this site