Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp390230ybn; Tue, 1 Oct 2019 23:10:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqxA5ZwvymFJY4ObjDJrd6MJ605K89d/XGnxmf9s6+b2eHQoVVAUemYQeLyFnAxKRqfExyZb X-Received: by 2002:a50:9512:: with SMTP id u18mr2002407eda.182.1569996656720; Tue, 01 Oct 2019 23:10:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569996656; cv=none; d=google.com; s=arc-20160816; b=Wm6ra4ylC5IitzFelsL4Jz0tqZcd77mWnxw1Zwv9RZZyOB2NoQ0cNQPfv8mnVxXWmt OTyizsrBK9bPkSTUZ/SktTw4P+KlJgBNREZ3+wVpr00YN0N1cw7IUXUlKD8toNG3VPpQ PrtLCoPKTxVXFS9AnhgeCLflz3kBlU6ZNr5QNMwPADxf+H38js7lIrQoSrp6KIeGquxU rV99NVqwzwM+YP0LWQoOJ+Ih0OMQMN3DR0j719/TYJYNEbousRAbxj4Vaeevb0hk5xjv zt+n02YTQgXDP763uccx4UiLk6kDD+ogy133oT1FUGODQCw3+JIr8heq7qxsHy7JnBBo pYww== 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:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=EcVg9u8V8Uf/idldytEF3NgOMyW0OU8oijTXHZJkyVg=; b=zuasTXFDNRGw4Dk3rq7c3svvnTOHcwE/+DZbU7Y2WOL+wWfmYHKd7Sy2gsVeS7xAwf QEPw0RKzMBaTV0fBQ7t9cLZpNplulL4AzSnH0ku3+739BwCBCqq1Dbojy0PVySNHiE1Q lgQBM3BQsliD1t24KghHCmkQR93E7irbbX5i//XDxUhAc2Zr54b6cg46B05p2SXAOO/p vHBMLCkgFgkS/8JzM2Bfuz5X2zgeZY5gk5ZKCK1T7P+o4x44Nxunded2g3uzUZgIJ/dd 7rm1uGyiSfuS7/M7jCk8kd8AQF1OirAWLHpB6owYbu4ItUskDMEjY2X6nplfT9VQHSCT ENHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="LoLWuA/z"; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j4si12487241edl.192.2019.10.01.23.10.32; Tue, 01 Oct 2019 23:10:56 -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=@chromium.org header.s=google header.b="LoLWuA/z"; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729060AbfJAX3b (ORCPT + 99 others); Tue, 1 Oct 2019 19:29:31 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:43520 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729052AbfJAX33 (ORCPT ); Tue, 1 Oct 2019 19:29:29 -0400 Received: by mail-pf1-f194.google.com with SMTP id a2so9227128pfo.10 for ; Tue, 01 Oct 2019 16:29:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=EcVg9u8V8Uf/idldytEF3NgOMyW0OU8oijTXHZJkyVg=; b=LoLWuA/zt6wQo9niY6rS50WlST0jKh8TXiLphIX/HwUpy05ohub5qr5fmX/ajPIl38 XXY9DeDYzLb3r6VQgb82GF+lkIrTF0YatAYRiWTOyE0EbZ19L9ZzOE4ZksI8EWzk99qF HppXuMICfou5mYFPWkwYg/UF2L+14P67qumf0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=EcVg9u8V8Uf/idldytEF3NgOMyW0OU8oijTXHZJkyVg=; b=jll2ZfuenTrzUDgG4CZp8W9NsVQV9qQwn8dVdB8yFjYSoCEq5sKW03lQGr0L2wY91s hWc1u1UK6Zyr/19ZWNPMsSe1pIwyQEkUaCJAboMHCpGWk5Vxjqc+2x7SXHLLYfp36iw4 MPztOi6OwQ4kMcLg7tsEN5gD/0P2bWyZUcfYiac3o+TpA5a08rLAk7vOh4PjjUvu0fRP QlKiRQu7eBq839amRdnssM8UxxFbQTCvBoa/hngMsvvBQn+KmJm8vpv5rIoTmX4balEl 3LAdeuqpFR0SCUp7ALchsVU8RLr8MMZ8Uhn/1RWr3nkTUBS/emyCHwUgu7lE6DJQeeJI Vp1A== X-Gm-Message-State: APjAAAXGihnJldvJjgv8Hwtlbm6BNHWWSoaUFK0LoQJcKi//3IosjQS6 h86IFjwtjf6+rVf6Ru+JzpqB+s72NDs= X-Received: by 2002:a62:fc46:: with SMTP id e67mr1005912pfh.153.1569972568837; Tue, 01 Oct 2019 16:29:28 -0700 (PDT) Received: from localhost ([2620:15c:202:1:4fff:7a6b:a335:8fde]) by smtp.gmail.com with ESMTPSA id c8sm20990266pga.42.2019.10.01.16.29.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 01 Oct 2019 16:29:28 -0700 (PDT) From: Matthias Kaehlcke To: Thierry Reding , Lee Jones , Daniel Thompson , Jingoo Han , Bartlomiej Zolnierkiewicz Cc: Matthias Kaehlcke , linux-pwm@vger.kernel.org, linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH] backlight: pwm_bl: Don't assign levels table repeatedly Date: Tue, 1 Oct 2019 16:29:24 -0700 Message-Id: <20191001162835.1.I4f2ede1f55ddd1c72b0303b7fd7f73a782fa33e5@changeid> X-Mailer: git-send-email 2.23.0.444.g18eeb5a265-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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