Received: by 10.192.165.156 with SMTP id m28csp383092imm; Mon, 16 Apr 2018 01:38:41 -0700 (PDT) X-Google-Smtp-Source: AIpwx49hXeqfTqIIu8HlL+K42Ih9w6/yaYvEQ0FlZFt1u1soS4pH3VOJWDurXtkfu4xZT2hhqWTs X-Received: by 10.98.78.21 with SMTP id c21mr20709676pfb.107.1523867921397; Mon, 16 Apr 2018 01:38:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523867921; cv=none; d=google.com; s=arc-20160816; b=mOlPlwEZdAn4fPTMIsfpD8Nct07MqB+4GkNo3BQ2MKPm61EkuSAtnFWdtkBEr2Y5yU vbYEhsYj0SRyaPcAeuHe/+3spjZVYrtgb+KWbVhgR8geA6eQ/xEnPMXHGU70T2EoWcKQ 6qF6cdmUtEwYoserab7fKbVwpDeCI1RKjHmoqsxs+/9obJrepmsr5jT/AmoTD0t/vYxT on/I++2aqcECNjCFqGom5iYTEbJ592yd2KREvFfY7yMt5LSRFUu4VdZUsLki5A9lpSMT cwIzMBqwas1Yljes5SCKSlbugX53LMrgMq3p0q5xjYoKYA+Ymmf4YZR1BjrdiTpb13GO 5B8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=prAxS5SDJ/nIDS+MMNfUU3xXhrLNDEyqXt/QDMoRB+4=; b=T/gr0YuPFFYfEGMLpgBjwiVDerSCsjsVC7rCIB5MPc8FQJTFTYzWLUhmSRoJ5yEaHq h1r4VM1E5Sk6GA0cTt7aQ8AEE2CCIfwKSUAlCeBqlQrFy7G8FYeSEHDfss5go4l1OzBh ToMFmToqRN1RhUdYIQYCpByjZKY4ojlkoa6zMf+MhSlxaIfbUkAmh3g4x5EyZUvLWqE9 F70IQgWtauDeci7CCxWC/5dQ8oxjJ2qWHGGU3UG8odlX6onPLvDzH+K1tNGbk1tYdqyt itHJiGcJ+ugWlwN/3Iie1RIW9c/OE2KsS7FkB8VY76M7Oyyy2yqzXA46F/Y3v3QCxuHG ETqA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a86si10599173pfc.207.2018.04.16.01.38.26; Mon, 16 Apr 2018 01:38:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754085AbeDPIhC (ORCPT + 99 others); Mon, 16 Apr 2018 04:37:02 -0400 Received: from smtprelay2.synopsys.com ([198.182.60.111]:52721 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752941AbeDPIhB (ORCPT ); Mon, 16 Apr 2018 04:37:01 -0400 Received: from mailhost.synopsys.com (mailhost2.synopsys.com [10.13.184.66]) by smtprelay.synopsys.com (Postfix) with ESMTP id 6F32810C0CD3; Mon, 16 Apr 2018 01:37:00 -0700 (PDT) Received: from pt02.synopsys.com (pt02.internal.synopsys.com [10.107.23.240]) by mailhost.synopsys.com (Postfix) with ESMTP id 143DF3843; Mon, 16 Apr 2018 01:36:59 -0700 (PDT) Received: from [127.0.0.1] (gustavo-e7480.internal.synopsys.com [10.107.25.102]) by pt02.synopsys.com (Postfix) with ESMTP id 3B3B13DFA0; Mon, 16 Apr 2018 09:36:59 +0100 (WEST) Subject: Re: [PATCH v2 8/9] PCI: dwc: Small computation improvement To: Fabio Estevam Cc: Jingoo Han , "bhelgaas@google.com" , "lorenzo.pieralisi@arm.com" , "Joao.Pinto@synopsys.com" , "kishon@ti.com" , "robh+dt@kernel.org" , "mark.rutland@arm.com" , "linux-pci@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "devicetree@vger.kernel.org" References: <5181f7ffbb9d2889974c49d84e72042251adf8b6.1523266508.git.gustavo.pimentel@synopsys.com> <003001d3d128$39f3eaa0$addbbfe0$@gmail.com> From: Gustavo Pimentel Message-ID: Date: Mon, 16 Apr 2018 09:35:55 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Fabio, On 15/04/2018 14:09, Fabio Estevam wrote: > Hi Gustavo, > > On Wed, Apr 11, 2018 at 4:40 AM, Gustavo Pimentel > wrote: > >> Can be this one? >> >> Probably any recent and decent compiler does this kind of substitution >> in order to improve code performance. Nevertheless it's a coding good >> practice whenever there is a division / multiplication by multiple of 2 >> to replace it by the equivalent operation in this case, the shift >> rotation. > > Subject says that this patch provides a computation improvement, but > as you said above the compiler > will perform the shift, so it doesn't seem we will get any benefit. In the worth case there is no performance, so it will not hurt having it. However depending the compiler and the platform this can bring some improvement. For instance like Jingoo said: "The most platforms using 'dwc' are based on ARM CPUs. So, the shift rotation can be better." It's just a attempt to improve the code that doesn't bring any harm. > > IMHO the original code has better readability as it makes easier to > understand that pp->cfg0_size will get the half of > resource_size(pp->cfg) size. Personally I prefer the shift rotation rather the division by 2. But in my case I'm used to use/see this type of operation, but it's like I said it's my personal opinion. > > I would say it is better to drop this patch from the series. Let's see this patch inflicts pain on someone else, in that case I'll remove from the series. > > Thanks > Regards, Gustavo