Re: [PATCH 2/2] staging: brcm80211: replace asserts close to Mac80211 interface

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

 



On Fri, Mar 25, 2011 at 01:52:57PM +0100, Roland Vossen wrote:
> >>
> >>>+     if (likely(hw != NULL))
> >>>+             wl = hw->priv;
> >>
> >>This isn't a fast path.  The likely() here is not needed.  It makes the
> >>code less readable for no reason.
> >
> >Good suggestion. Agree.
> 
> Come to think about it a bit better: I would say that the 'likely'
> makes the code more readable since it indicates to the reader what
> the 'sunny flow' is. Is there a common consensus on the usage of
> likely/unlikely ?
> 

Eep!!! That kind of thinking is what lead to COBOL.

Basically, if it shows up on benchmarks then it shoud definitely be
marks as likely()/unlikely() but by default it should be left out.

regards,
dan carpenter

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux