From patchwork Tue Apr 28 21:30:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 11515705 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8CE6492C for ; Tue, 28 Apr 2020 21:44:24 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7682E20730 for ; Tue, 28 Apr 2020 21:44:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7682E20730 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arndb.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 25B7F6E8B3; Tue, 28 Apr 2020 21:44:23 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org X-Greylist: delayed 466 seconds by postgrey-1.36 at gabe; Tue, 28 Apr 2020 21:44:21 UTC Received: from mout.kundenserver.de (mout.kundenserver.de [217.72.192.74]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1CBB76E868 for ; Tue, 28 Apr 2020 21:44:20 +0000 (UTC) Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue108 [212.227.15.145]) with ESMTPA (Nemesis) id 1M9WmQ-1jZ47l0nHo-005W2P; Tue, 28 Apr 2020 23:31:09 +0200 From: Arnd Bergmann To: Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , David Airlie , Daniel Vetter , =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= Date: Tue, 28 Apr 2020 23:30:50 +0200 Message-Id: <20200428213106.3139170-1-arnd@arndb.de> X-Mailer: git-send-email 2.26.0 MIME-Version: 1.0 X-Provags-ID: V03:K1:rYIYDMxCYWRB2eFt+r4bXR0ojs6VRf8cssYFP45eloPQBq3kk1D 38AbGpfXilhQ2jU3p6Hjd0QcD2HvV3U+BhpEpeAKZtbVB3ZQ/FfFecRn74a+7glEdjBtxhN mCtjym4QUZYwirc3/24PVfET6sA4U1JkY6ymVG2ainX3OdXVUT7FrO8C3wZUz7tT3mANQiP 1CtPuSaxk0HHZM5ZPj5zQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:fCvYI43h4qw=:zJE86n2XR4/zwbmsqs1PsD uWeN4V5QvJ5OfS1qUq+gSGWOVuQFCnCX2CdQJTA3DTdTvCs/0A04ASgSjg7D3IglWEB6oMs3T xD5gHABRLhMNvQ38prGDQmJWh298oBemJO6BJicnPmuMJuTCLv50peWcUZluUfp8l340+3fSM kTXf3g6O9LQjziB7LahXMwcM4x1hCw/lPaQxQWa7nGWEI1V4lkFzDWDDb5Zx41VyksshiJgF8 CKxN/mUNUz/aiBh1EUwM+483AAaMd6A3JK+hVtf/4ECfHiglXcx1MwAhzWNuh/G1OnYYEqpVH ybdEfViT5K0s6V7rdWFpubIDLFn8MldPvmfkPDk7ySMhv+i4Wh773uMjcHYTv9QwW7d+qXjtY S54qK+b37YFv/t3Hena6LRpK4KexgqaKoLjpus0a7jD0raOqPk+ZF2qIQyQsRnOSEzTq5c13N 2qK6vxScrRMf+97fTH5gwEvYJJFDAyK9W/Ub5kF6jMEdfQ+jFtKHsPqlTE2BN1c5zGN6aL3cI mqbiwsp5m8jQRcSqdyWB+lEbNvZ1F6yKXIriXL6dxjr4xIUy52yQY+/kN5TWNEs9qFgv/GAG7 6OkJedi6a4mRrfDURxJAa8YIul61LAPw+8apa4eid7H6ee6+GpLZLhhICfqYSvDe8rUBPAg/+ 1PCcNZqj54JYPtogAxivyCo/6CMWiDmyHrCsXZXQKamSJRS/NW9R0N7NHHpkrT0foNxyNBnOI zXGUEdqQ5JIs23BKKxZCLthcTKLR5/Qo9T6o7XDXy24wzDXYabNNMNa2BkuE+7pZM5g1RblCP iXrZu5dccnpJhjFTZL8br97URWb8T5FVlnBVakjoH+kFmWxQ0Y= Subject: [Intel-gfx] [PATCH] drm/i915: avoid unused scale_user_to_hw() warning X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Arnd Bergmann , Jani Nikula , intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Chris Wilson Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" After the function is no longer marked 'inline', there is now a new warning pointing out that the only caller is inside of an #ifdef: drivers/gpu/drm/i915/display/intel_panel.c:493:12: warning: 'scale_user_to_hw' defined but not used [-Wunused-function] 493 | static u32 scale_user_to_hw(struct intel_connector *connector, | ^~~~~~~~~~~~~~~~ Move the function itself into that #ifdef as well. Fixes: 81b55ef1f47b ("drm/i915: drop a bunch of superfluous inlines") Signed-off-by: Arnd Bergmann --- drivers/gpu/drm/i915/display/intel_panel.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_panel.c b/drivers/gpu/drm/i915/display/intel_panel.c index 4279d2bf884a..92ed67e21c60 100644 --- a/drivers/gpu/drm/i915/display/intel_panel.c +++ b/drivers/gpu/drm/i915/display/intel_panel.c @@ -489,16 +489,6 @@ static u32 scale(u32 source_val, return target_val; } -/* Scale user_level in range [0..user_max] to [hw_min..hw_max]. */ -static u32 scale_user_to_hw(struct intel_connector *connector, - u32 user_level, u32 user_max) -{ - struct intel_panel *panel = &connector->panel; - - return scale(user_level, 0, user_max, - panel->backlight.min, panel->backlight.max); -} - /* Scale user_level in range [0..user_max] to [0..hw_max], clamping the result * to [hw_min..hw_max]. */ static u32 clamp_user_to_hw(struct intel_connector *connector, @@ -1255,6 +1245,16 @@ static u32 intel_panel_get_backlight(struct intel_connector *connector) return val; } +/* Scale user_level in range [0..user_max] to [hw_min..hw_max]. */ +static u32 scale_user_to_hw(struct intel_connector *connector, + u32 user_level, u32 user_max) +{ + struct intel_panel *panel = &connector->panel; + + return scale(user_level, 0, user_max, + panel->backlight.min, panel->backlight.max); +} + /* set backlight brightness to level in range [0..max], scaling wrt hw min */ static void intel_panel_set_backlight(const struct drm_connector_state *conn_state, u32 user_level, u32 user_max)