Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp563953pxk; Thu, 1 Oct 2020 08:59:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxPztvQnXJ45vjAXjseVkJQnqQxCgYm4+ahpFRFVIRAoTR+wyyzRawdB6U7Z5HxvC89UO60 X-Received: by 2002:a50:ab5b:: with SMTP id t27mr8203049edc.281.1601567992720; Thu, 01 Oct 2020 08:59:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601567992; cv=none; d=google.com; s=arc-20160816; b=kWjb+rxX5AYS05eoSNvAB3MbGvoKPc+LFQts5k2YBayL1N38ZAYANSwNiddle8KchS RhZtyHyHnxgRIL1erbi2reVGaMsUlp04dtAmmRotB0hWVK0gAZTLktbxX1ojFKul+d4S k9/WW73xZ87OI6wPaY3Nm6Uiygh8nZ64JmKWs/WAX71TkOIAGQhmWKIqkynJQb+XiJPl Eze/esgEXDPsEJfXUtWPqaDTdxZuPFxuwwNu2fEEuct9wngtSsuROH1VZ9SlvbsZiq6M XyhRuI7opDtqvZ5uZzmiJ4vHEvX+skFI3kbqOjlMyRen3Tcs8yiv0XbubVKUqNDODZvs 6P6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=SRUfXx1tkp/QekG2Ke1Y6KhJGd+TREeNEGxUtPO63mU=; b=vU6Q9DEGDSz9PNWacjO2PZSV5EWl6gM925VbmQbYkqrK8tgf3zt88vlJy7rWaXzTgU It8gu1qUqkFprqn8HNU7TmkjiTfOgypS1zkktohZaexjwNycMSsQsU3BPLaPwCEFXwjX U6OJsF/N6YSyl48NI2G6DhEEyoEsU95LnIxz9suqqtQNi376kJoM2PQEmj+LDOpKhZwv NDa6xrCCfnM+ZPd4MXVp0KAfC4JgBWy5YqX/4Vm6q/df+3MnUXYXk4v7D9pO9nQutzbq B/sYUj8lyLaHD/bLqaoJZPPyNOpT4ncNpCkS+Ai2ijyLsrYBUf3a+pqNmeEkBoGk8B79 JqMQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bs7si3767351ejb.410.2020.10.01.08.59.29; Thu, 01 Oct 2020 08:59:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732670AbgJAP51 (ORCPT + 99 others); Thu, 1 Oct 2020 11:57:27 -0400 Received: from smtp08.smtpout.orange.fr ([80.12.242.130]:60462 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732213AbgJAP50 (ORCPT ); Thu, 1 Oct 2020 11:57:26 -0400 Received: from tomoyo.flets-east.jp ([153.230.197.127]) by mwinf5d31 with ME id afxE2300B2lQRaH03fxLjb; Thu, 01 Oct 2020 17:57:24 +0200 X-ME-Helo: tomoyo.flets-east.jp X-ME-Auth: bWFpbGhvbC52aW5jZW50QHdhbmFkb28uZnI= X-ME-Date: Thu, 01 Oct 2020 17:57:24 +0200 X-ME-IP: 153.230.197.127 From: Vincent Mailhol To: Greg Kroah-Hartman Cc: Vincent Mailhol , Jakub Kicinski , Oliver Neukum , Masahiro Yamada , Arunachalam Santhanam , Marc Kleine-Budde , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-can@vger.kernel.org, Wolfgang Grandegger , "David S . Miller" Subject: Re: [PATCH v2 5/6] can: usb: etas_es58X: add support for ETAS ES58X CAN USB interfaces Date: Fri, 2 Oct 2020 00:56:41 +0900 Message-Id: <20201001155641.3421-1-mailhol.vincent@wanadoo.fr> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200930161838.GB1663344@kroah.com> References: <20200926175810.278529-1-mailhol.vincent@wanadoo.fr> <20200930144602.10290-6-mailhol.vincent@wanadoo.fr> <20200930161838.GB1663344@kroah.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > + 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. All those branch on which the unlikely() macro were applied were supposed to never been executed under normal circumstances. But I indeed have no benchmark to claim such use. Thank you for the detailed explanation, makes perfect sense. Each use of the likely()/unlikely() macros will be removed in v3 revision.