Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp4657471ybp; Mon, 7 Oct 2019 11:44:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqzMlp6Wy4qiSkRgiIU9w6kVGntxgoDJPzQZiuT9j9ipl3S5Uy1kan/JU3K9yT0bD/YzCx1h X-Received: by 2002:a50:d808:: with SMTP id o8mr30280658edj.74.1570473857173; Mon, 07 Oct 2019 11:44:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570473857; cv=none; d=google.com; s=arc-20160816; b=EKHdIoj9+Zl5Xo6f+WiT+ZopzBTiT/KIqQViKRljO+neUKQt1aOgFVSamEWo5nQiKT EEZmR28R5QljpwxP+IgYTXwkjyD3i+W9VgVwVnQxjZlEQTyx973JYrgwu57GsugDDcEK DIrN/zS0zYAktfOyYc9fsoPFcKEw8SkN/BvnHCrTugKjRf7DnE+W6dyaVMi/TVEMRM49 XAIzVJkcpAk5qOMFx8JHrj/5OqvX8yE3bEtiPQU3y/F/KEErbBgyJGQazjvVgb6XKqmC p1H0eCqoipBWfkGbq4vz1mb6lVi2qHUmElnSf0XHADEwGjX6vyDsEnLGcDm8G84aJ2Vn RxWA== 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:dkim-signature; bh=ZuQdDyWsqYD2ABpjzuaYMlyNtofNUDV9L/YfiTkcKyw=; b=XFHmgt2jK0AZ6E9E5k5K0hlK0+NIMDoTzb+F4pl8Kr4jx5k/5Cw8a26JKG0vAVdZz/ pJMYioFnBPMSx5WiXcozqSoAgT8EsmRZrQdCtGa73IiI/gaAxz3g62cOzXTLFH/LsUKN Lmb4N91BJbUO+lwgLc6La1r0DWbWvrAZ0ldcMi7Yk+G26SSYDBvzRUtHpJ/QH/Uw96cF ivWAOCzSEpCj/j3AmPaF2mpj0FkXgYp9lx1t8yysWEKN/V9yQBGS/I93lw3ROZMGd3rR t1E2LFlbQQpXkCT8LXHSsjGb+JJhY/gaX29j7Qo7t2jxK3dUjlb03B/mlJTC02SN3o6O Iv/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=AtuT6ONe; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i20si8655118edy.426.2019.10.07.11.43.53; Mon, 07 Oct 2019 11:44:17 -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=@rasmusvillemoes.dk header.s=google header.b=AtuT6ONe; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728702AbfJGSnh (ORCPT + 99 others); Mon, 7 Oct 2019 14:43:37 -0400 Received: from mail-ed1-f68.google.com ([209.85.208.68]:38315 "EHLO mail-ed1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728242AbfJGSnh (ORCPT ); Mon, 7 Oct 2019 14:43:37 -0400 Received: by mail-ed1-f68.google.com with SMTP id l21so13409772edr.5 for ; Mon, 07 Oct 2019 11:43:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=ZuQdDyWsqYD2ABpjzuaYMlyNtofNUDV9L/YfiTkcKyw=; b=AtuT6ONerZTAjRxy0hah42Bky6hjxkP4woYIr+bGSczhAipeFOav21Z1EHHKAgOYcw OpYPAW/p8M/c/E152ZeiMojnVRl3VCuBWf9gipumax7CyDatkTSeIaHiukmskK10TS7e Wt1bS84GEhhkbBj2nZo1C7iLWFzHw7yB/IvOk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=ZuQdDyWsqYD2ABpjzuaYMlyNtofNUDV9L/YfiTkcKyw=; b=KKeLX+s3pjOuPFTzr3v/dF3FYt8Z4adHpyBq61cfEgIHxIzJ2hOMdoAwBEVm8cc9sS o1uC1s6n2oTfLftRV72AOht0+DbGQ+wi9w4jaBwpnE/ZjKMom3hIeK297K2sQZ0uy4HO lxyGtdCCGu0ESU9CegtAklQWwBkNF4bsr4d10c13mV0xh9Pow5s+WGTwjdyB2uIoQ/Df i4sJ4wrU3f67BTZRxLuc/pLDAflv6RMlPbaUh3IOYli3ZnbL0NnVtgE8mjQxcPvnr0ym c/2XB6ut/fIWkcnMJjorODV6yzxXkUMRuUCyLM1i8VZBOkm5cxGjlzteBfJSOTX4dCt6 4d5g== X-Gm-Message-State: APjAAAUwlkBUHgYsU4KY0316OZuEAJdHxHb+pkg1PaiTF+RWJZNOg+YJ YqZyllv8oySHgoFPyF1N+CLiekLUroOmCPCq X-Received: by 2002:a50:9fe5:: with SMTP id c92mr30392512edf.280.1570473813954; Mon, 07 Oct 2019 11:43:33 -0700 (PDT) Received: from [192.168.1.149] (ip-5-186-115-35.cgn.fibianet.dk. [5.186.115.35]) by smtp.gmail.com with ESMTPSA id k10sm3487005edb.68.2019.10.07.11.43.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Oct 2019 11:43:33 -0700 (PDT) Subject: Re: [PATCH 3/5] backlight: pwm_bl: drop use of int_pow() To: Daniel Thompson , 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 References: <20190919140620.32407-1-linux@rasmusvillemoes.dk> <20190919140620.32407-3-linux@rasmusvillemoes.dk> <20191007152800.3nhbf7h7knumriz4@holly.lan> From: Rasmus Villemoes Message-ID: <5f19e307-29c4-f077-568d-b2bd6ae74608@rasmusvillemoes.dk> Date: Mon, 7 Oct 2019 20:43:31 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20191007152800.3nhbf7h7knumriz4@holly.lan> Content-Type: text/plain; charset=windows-1252 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 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.] Rasmus