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, 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)) ?

> BUG() never returns. Same for all the other places you pointed out.

Yes.  And I used BUG() on the notify chain calls, because the primitives in
the kernel code are not doing proper error checking anyway (for speed, I
suppose)...  they just OOPS.

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[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