Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp5419303ybp; Tue, 8 Oct 2019 02:32:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqwJtI8el95Ynbv/7TYtvvIo4qmRwEv1JZaotbL8yjhv++BVEVioPZe+0d3gcdjOtHMUfqDo X-Received: by 2002:a17:906:254d:: with SMTP id j13mr27847407ejb.30.1570527169406; Tue, 08 Oct 2019 02:32:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570527169; cv=none; d=google.com; s=arc-20160816; b=mFajd+QhB7N4aL6zeT0iDxdSVRMYXkQltuUFxNNJW2dJbgdL78zJxDsko8P+LuWcyU Gy8br9u0F8KJNiPUZVhxReeoeI3DSH8Ts/ovIX6WMW64JqrNAg4A5Pqg2i5285qI6Bz9 igQr7I63I8+1CE9yTaMmRozOFtNJLg0/dxAo/0s8+i0tum4cyqYo6CpbIrQXmcGxiUjG cGYbiD9bi4aCe1awpk9FSFSXwsSeSF7eMoccPaP0LQkdrjb7qsDyHrJ3zxbcFAyzAUlb esJGmAMrdevFS2ieWCcc96NGhaiFgNkGu18fnWbv07nLNwrkgK6ly67WslEMLHa10iVb F1Sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=EazPgAo0KA2L5bP4whOU0gOC5nZeJshj93xKT7W2t+s=; b=Rlr6DJNtTQ422q3QX4Y9fbM9YonsiRKJDXlHR/a7kYA02k+UsVNlb29SFYcVGJy0T+ 7l+bENdZrmXO0dHn65mgT/+ufP6K6vkUEJH2lmCuUgZKoohpZwemMjunAKcUwJIBVPHu bB3G5ZuJRHibJNBNFjh9a3uEx5dPgcNx5njNgTwNVXhqV6Ogj15qoVHj29JhA2sCuwfe m37k+ruk7XZVtLot3tQJWXgImbfY1OWUvcKq2XUXxNGpWIrM5pL+y2mrj4lNbao2A6yO ku+K0LnZ6SBUWKvt4b/3aQLxNJiIfQkcBJwO/yrnHFS2HfhZj2V4RSJlOFGaje9/gfhh K5Mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LvRJZ6xd; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b16si8712847ejb.165.2019.10.08.02.32.25; Tue, 08 Oct 2019 02:32:49 -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; dkim=pass header.i=@linaro.org header.s=google header.b=LvRJZ6xd; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729935AbfJHJbu (ORCPT + 99 others); Tue, 8 Oct 2019 05:31:50 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:42266 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729375AbfJHJbu (ORCPT ); Tue, 8 Oct 2019 05:31:50 -0400 Received: by mail-wr1-f67.google.com with SMTP id n14so18486730wrw.9 for ; Tue, 08 Oct 2019 02:31:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=EazPgAo0KA2L5bP4whOU0gOC5nZeJshj93xKT7W2t+s=; b=LvRJZ6xdJUrFyuFeAodhiVrfTO3DINKsAGx5CCndd95qCzlD3/66+r3BM6b4TVrhk8 Qcgcu2flQ2+Umci8gVj+SNBnKTRagow1zCD7w+Nc1xtPRN+0+xMTp+adeKR92rYh5Y8P ZL9bIDvNsNdzq3OwbVBOY+1I/eF0YDPhfTzMPpOFZ9rtQrdHk86cgQLIN0q44I0qa2yG 9+WhoLIspFeot/bC/hvdfCot1SYQi0S+uCAJe2t9uzGAPIC0waYd+AnylUcFUXwyWG7w 6h/9fe1CFTmkV24gQe0sTW8D8A8y3Cutm0sZgtDX6ywbw6oa6vDO4xmLo0+HvVKuYwL2 hKDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=EazPgAo0KA2L5bP4whOU0gOC5nZeJshj93xKT7W2t+s=; b=cJdUo/MjkK6Es0HVZJ0eh6wbZHzev2nZMUpYCVPd0RLwQFUxjqh9VlWtXSpgsMHemQ l4F2GobftWSXNA4XosVcPuxWK+4S9QEt1fwcHYg7sg7lkewWGx8tyCVHG79aGupCRflw fxXf1d/xzOFPaKE1WmvwNsRNGPnauZKBd95hKkA/gPAYiqXPvC+rX7q+7IYU6DpSUi1g KrrOY24+tNQIfvdQAS/fR4SQcVnclQ6MQqNg3JJ3eekpEDNNpV4zIj5QHmpRyDKbjHcW nkeQgtmAvITie1UhHm2ovK3haiWbokQUfaRGmXgADpv55Cro96JPqJJPW2mems4OQncj Lk6Q== X-Gm-Message-State: APjAAAUw9hCxnimg7HpWxPHiXvy7ElIAQSWKcOJ8v3Kt9mHUT5FGYnR5 oa1IGYHY6/DuWUW8f/l0YzGkrA== X-Received: by 2002:adf:e3c8:: with SMTP id k8mr14526118wrm.268.1570527108416; Tue, 08 Oct 2019 02:31:48 -0700 (PDT) Received: from holly.lan (cpc141214-aztw34-2-0-cust773.18-1.cable.virginm.net. [86.9.19.6]) by smtp.gmail.com with ESMTPSA id i11sm7291389wrw.57.2019.10.08.02.31.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Oct 2019 02:31:47 -0700 (PDT) Date: Tue, 8 Oct 2019 10:31:45 +0100 From: Daniel Thompson To: Rasmus Villemoes Cc: Thierry Reding , Lee Jones , Jingoo Han , Bartlomiej Zolnierkiewicz , linux-pwm@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/5] backlight: pwm_bl: drop use of int_pow() Message-ID: <20191008093145.kgx6ytkbycmmkist@holly.lan> References: <20190919140620.32407-1-linux@rasmusvillemoes.dk> <20190919140620.32407-3-linux@rasmusvillemoes.dk> <20191007152800.3nhbf7h7knumriz4@holly.lan> <5f19e307-29c4-f077-568d-b2bd6ae74608@rasmusvillemoes.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5f19e307-29c4-f077-568d-b2bd6ae74608@rasmusvillemoes.dk> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 07, 2019 at 08:43:31PM +0200, Rasmus Villemoes wrote: > On 07/10/2019 17.28, Daniel Thompson wrote: > > On Thu, Sep 19, 2019 at 04:06:18PM +0200, Rasmus Villemoes wrote: > > > > It feels like there is some rationale missing in the description here. > > > > What is the benefit of replacing the explicit int_pow() with the > > implicit multiplications? > > > > > > Daniel. > > > > > >> > >> We could (and a following patch will) change to use a power-of-2 scale, > >> but for a fixed small exponent of 3, there's no advantage in using > >> repeated squaring. > > ^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > Apart from the function call overhead (and resulting register pressure > etc.), using int_pow is less efficient (for an exponent of 3, it ends up > doing four 64x64 multiplications instead of just two). But feel free to > drop it, I'm not going to pursue it further - it just seemed like a > sensible thing to do while I was optimizing the code anyway. > > [At the time I wrote the patch, this was also the only user of int_pow > in the tree, so it also allowed removing int_pow altogether.] To be honest the change is fine but the patch description doesn't make sense if the only current purpose of the patch is as a optimization. Daniel.