Search Linux Wireless

Re: [PATCH 5/8] rfkill: add WARN_ON and BUG_ON paranoia

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 2008-08-03 at 10:21 -0300, Henrique de Moraes Holschuh wrote:
> On Sun, 03 Aug 2008, Johannes Berg wrote:
> > if (WARN_ON(!nb))
> > 	return -EINVAL;
> 
> I could use the notation above instead of:
> if (foo) {
> 	WARN_ON(1);
> 	return -ERROR;
> }
> 
> Ivo, which one you prefer?  The if() with the condition and WARN on the
> branch, or the if(WARN_ON(condition)) ?

You really should either just BUG() as you guys seem to have decided on,
which is fine with me, or use if(WARN_ON()) because that'll also put in
an unlikely() etc.

johannes

Attachment: signature.asc
Description: This is a digitally signed message part


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux