lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200930161838.GB1663344@kroah.com>
Date:   Wed, 30 Sep 2020 18:18:38 +0200
From:   Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To:     Vincent Mailhol <mailhol.vincent@...adoo.fr>
Cc:     linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
        linux-can@...r.kernel.org, Wolfgang Grandegger <wg@...ndegger.com>,
        Marc Kleine-Budde <mkl@...gutronix.de>,
        "David S . Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Masahiro Yamada <masahiroy@...nel.org>,
        Arunachalam Santhanam <arunachalam.santhanam@...bosch.com>,
        Oliver Neukum <oneukum@...e.com>,
        "open list:USB ACM DRIVER" <linux-usb@...r.kernel.org>
Subject: Re: [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.

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ