Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp708953ybn; Wed, 2 Oct 2019 05:05:13 -0700 (PDT) X-Google-Smtp-Source: APXvYqzBxwz5iCvFdgls2PZ7oDUReC/M5rOf7SzQCNVThmgx69MkUp57rNq8PyOvQtASGdMgbLq0 X-Received: by 2002:a50:e616:: with SMTP id y22mr3279434edm.253.1570017912754; Wed, 02 Oct 2019 05:05:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570017912; cv=none; d=google.com; s=arc-20160816; b=ZlUbuvLHz8+aRKltSEjYOhj4p19ED4W7WDLXxbTI6f9bWs5EFPe05sHZfq3DaalxfM Jjii2A/brTSAdZQ6FpYBiUHW7lruhPYfLMBp5ssobxUESK3U8j4tCegD+igIK6EsagI5 qlZaGRTmDgmEW8oX81k9ZD1p9EgbAlNapbkZ4PWDpGu7Ac6BYn2Bbc+FHAxZVVPYumaD CTIEwZ4LByGdXcjEhrP3KgLQ4LCALEds19GZ97DFtdlF3IKRsdn6zN+ptGnBGNWth8M5 wl2nAzwUiFSVHgD9pX3QnNvt9aN78iua++k8YfWdi6msW0W1YgnBAr4QY/otg2YkGvmv DG3w== 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=8215o5L5rg8Jn8PvXMpKTkwp0UWQ7G/wTp1RzC1miWw=; b=iFEqwwbAf5WB83CUDdh16JrbOUhPuNU6f53hL1cq9gUHboLZgEURdPIA28KTz0u/Pf LnBlxSStBvA2j4K2Yup913fW8o3Mb1gmhVm9pEKkc4cU6j/fgZ+CQliNc1POWqVgMsSx 80btXRZXgKJT3cai8/nKGqGB+zGR2R59P1Gq0cbDDC3MxzU5zejGVMwGwD+xDi7YZ8oF OdhQiEA/N8p3KDAaVY7f2zz+wCaV951y7ygf7DgfVEi9ONuyVOXOj4T6njvBeK+57j7M 6fSTf0NngXW/lKsIsnSZEHojkFV2twjdRXoK7xYmszF/1zxShbQqIsO7BiTh5qBi7r4k w92Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DTOctIKi; 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 v53si11824443edc.378.2019.10.02.05.04.43; Wed, 02 Oct 2019 05:05:12 -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=DTOctIKi; 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 S1727482AbfJBKHn (ORCPT + 99 others); Wed, 2 Oct 2019 06:07:43 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:36122 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727468AbfJBKHm (ORCPT ); Wed, 2 Oct 2019 06:07:42 -0400 Received: by mail-wr1-f65.google.com with SMTP id y19so18947768wrd.3 for ; Wed, 02 Oct 2019 03:07:40 -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=8215o5L5rg8Jn8PvXMpKTkwp0UWQ7G/wTp1RzC1miWw=; b=DTOctIKi3TC2V8YqzjCVfP8yozCtDlf8lmDyvwawFn4uwT6vW3n9HK5xwOA1/PeVkj hYjrjyDHa35kI9OABP5WohPSLTGuWvoY+OPWGhLf/fqyJR7HyQiSJSHoGwlmN+Ah4k44 1i3zI4m+GCjKqaVunXUELVhlFNbSqi677sTPrZIJMJP2GJtwwme1oHWKFVMePdL8KZyE 8H6j8VnX/Y6ZNU1tjewA/nS8T5eFlr9UEWKHJERc0ocvqo1pKobJllgI75ZNnChUQ3pF pMCRm4IjIUSyaQ8DHqx2EBwPQhYBZeb5c575NSy4GaTQWrNWyVKOCu3zogO8bywGoc2j OnYg== 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=8215o5L5rg8Jn8PvXMpKTkwp0UWQ7G/wTp1RzC1miWw=; b=B8yAMkzgCw2PVv07kB1CpcW28FzF1cWYS9CGPFJcgY5Zl/9gnOa8XiJQFAdrDXcNxp xyaLS9ZGZV80u4s+Q3cktXllyISwEv7FplFJEcibcb8nxNbeSYm8XqStdhcHIFuhUwZ6 1Jqcmd7lRVUXUx6t4HPdRwh/bjeFkc1x6wZFdBlBvS3jsnAKpGWbKt1dfWEdk79CsDwO aCDAd/AXZqSUyJwoTHHjQR7oI69I9p88lw5v/xKbeV6u9UCSvZ78X2CsBBBidnN/cY1p POqUVb2pT9z1i6I8dWzYgafh1Igru+r8s/+JsQnuk1R2e7uLUuzqASumPX7Xf5DEfGZV xgYQ== X-Gm-Message-State: APjAAAWOQDxw9YfxA3HpQJhnH33NfyXPt2MgB4gqvXf5eAiPF/C17hgu 36hmUfUD0boPl/xv6jgxHTIqTA== X-Received: by 2002:adf:dbce:: with SMTP id e14mr1946992wrj.56.1570010859481; Wed, 02 Oct 2019 03:07:39 -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 g4sm25657217wrw.9.2019.10.02.03.07.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Oct 2019 03:07:38 -0700 (PDT) Date: Wed, 2 Oct 2019 11:07:37 +0100 From: Daniel Thompson To: Matthias Kaehlcke Cc: Thierry Reding , Lee Jones , Jingoo Han , Bartlomiej Zolnierkiewicz , linux-pwm@vger.kernel.org, linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] backlight: pwm_bl: Don't assign levels table repeatedly Message-ID: <20191002100737.orm5ghpnw6oe6b3r@holly.lan> References: <20191001162835.1.I4f2ede1f55ddd1c72b0303b7fd7f73a782fa33e5@changeid> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191001162835.1.I4f2ede1f55ddd1c72b0303b7fd7f73a782fa33e5@changeid> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 01, 2019 at 04:29:24PM -0700, Matthias Kaehlcke wrote: > pwm_backlight_probe() re-assigns pb->levels for every brightness > level. This is not needed and was likely not intended, since > neither side of the assignment changes during the loop. Assign > the field only once. > > Signed-off-by: Matthias Kaehlcke Makes sense but this should probably be dropping the curly braces too. Daniel. > --- > > drivers/video/backlight/pwm_bl.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c > index 746eebc411df..959436b9e92b 100644 > --- a/drivers/video/backlight/pwm_bl.c > +++ b/drivers/video/backlight/pwm_bl.c > @@ -564,6 +564,8 @@ static int pwm_backlight_probe(struct platform_device *pdev) > memset(&props, 0, sizeof(struct backlight_properties)); > > if (data->levels) { > + pb->levels = data->levels; > + > /* > * For the DT case, only when brightness levels is defined > * data->levels is filled. For the non-DT case, data->levels > @@ -572,8 +574,6 @@ static int pwm_backlight_probe(struct platform_device *pdev) > for (i = 0; i <= data->max_brightness; i++) { > if (data->levels[i] > pb->scale) > pb->scale = data->levels[i]; > - > - pb->levels = data->levels; > } > > if (pwm_backlight_is_linear(data)) > -- > 2.23.0.444.g18eeb5a265-goog >