Commit 794bdcf7 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Chris Wilson

drm/i915: avoid unused scale_user_to_hw() warning

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: 81b55ef1 ("drm/i915: drop a bunch of superfluous inlines")
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20200428213106.3139170-1-arnd@arndb.de
parent 963f328b
...@@ -489,16 +489,6 @@ static u32 scale(u32 source_val, ...@@ -489,16 +489,6 @@ static u32 scale(u32 source_val,
return target_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 /* Scale user_level in range [0..user_max] to [0..hw_max], clamping the result
* to [hw_min..hw_max]. */ * to [hw_min..hw_max]. */
static u32 clamp_user_to_hw(struct intel_connector *connector, static u32 clamp_user_to_hw(struct intel_connector *connector,
...@@ -1255,6 +1245,16 @@ static u32 intel_panel_get_backlight(struct intel_connector *connector) ...@@ -1255,6 +1245,16 @@ static u32 intel_panel_get_backlight(struct intel_connector *connector)
return val; 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 */ /* 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, static void intel_panel_set_backlight(const struct drm_connector_state *conn_state,
u32 user_level, u32 user_max) u32 user_level, u32 user_max)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment