[lkml]   [2020]   [Sep]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH v2 5/6] can: usb: etas_es58X: add support for ETAS ES58X CAN USB interfaces
On Wed, Sep 30, 2020 at 11:45:32PM +0900, Vincent Mailhol wrote:
> + num_element =
> + es58x_msg_num_element(es58x_dev->dev,
> + bulk_rx_loopback_msg->rx_loopback_msg,
> + msg_len);
> + if (unlikely(num_element <= 0))
> + return num_element;

Meta-comment on your use of 'unlikely' everywhere. Please drop it, it's
only to be used if you can actually measure the difference in a
benchmark. You are dealing with USB devices, which are really really
slow here. Also, humans make horrible guessers for this type of thing,
the compiler and CPU can get this right much more often than we can, and
we had the numbers for it (someone measured that 80-90% of our usages of
these markings are actually wrong on modern cpus).

So just drop them all, it makes the code simpler to read and understand,
and the cpu can actually go faster.


greg k-h

 \ /
  Last update: 2020-09-30 18:19    [W:0.264 / U:0.628 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site