From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E9753C4727C for ; Wed, 30 Sep 2020 16:18:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9C1B020789 for ; Wed, 30 Sep 2020 16:18:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601482718; bh=FZDd9NrX/b3X4mhyCraw4fkVuDp38h8GVcG5bQ6IPOY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=I+mCcsONeZJSY3k7HIbIzYibRRex1O/vZEn1Zfl5cpED3MFYjsNb6hLoCZ8nMznTX AKmm25vQ2V8rwVLbHB2PkEWaXdzSwi32Jfk5hk5LjKGImiqDPBSZsObH5w5ejqV/Cp 5eVK+GqRkgtDip/j7UYIwBEnvhlXAEM1r4lDUndg= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731160AbgI3QSh (ORCPT ); Wed, 30 Sep 2020 12:18:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:46106 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728744AbgI3QSh (ORCPT ); Wed, 30 Sep 2020 12:18:37 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id F223120708; Wed, 30 Sep 2020 16:18:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601482716; bh=FZDd9NrX/b3X4mhyCraw4fkVuDp38h8GVcG5bQ6IPOY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=D7dOdHbAvycDMu4PnK4XYyk/tC2brcv/Hwix+oIE4qjeoZ8xW7wMDdN4A2R/g3WIa YsGQKbpds+73FShsHxCwNy5uwRqdPjJnXOk/I1BvRu+y8S+Z+icclMvJ14HjPP/src NX4ao28aABFZeohCKkrOJrqptQ1EcL5/zsbgYr1c= Date: Wed, 30 Sep 2020 18:18:38 +0200 From: Greg Kroah-Hartman To: Vincent Mailhol Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-can@vger.kernel.org, Wolfgang Grandegger , Marc Kleine-Budde , "David S . Miller" , Jakub Kicinski , Masahiro Yamada , Arunachalam Santhanam , Oliver Neukum , "open list:USB ACM DRIVER" Subject: Re: [PATCH v2 5/6] can: usb: etas_es58X: add support for ETAS ES58X CAN USB interfaces Message-ID: <20200930161838.GB1663344@kroah.com> References: <20200926175810.278529-1-mailhol.vincent@wanadoo.fr> <20200930144602.10290-6-mailhol.vincent@wanadoo.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200930144602.10290-6-mailhol.vincent@wanadoo.fr> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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