diff mbox series

[8/8] drm/i915/pps: Eliminate pointless get_delay() macro

Message ID 20241106215859.25446-9-ville.syrjala@linux.intel.com (mailing list archive)
State New
Headers show
Series drm/i915/pps: Some PPS cleanups | expand

Commit Message

Ville Syrjälä Nov. 6, 2024, 9:58 p.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Now that we have pps_units_to_msecs(), get_delay() looks
rather pointless. Nuke it.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/display/intel_pps.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

Comments

Jani Nikula Nov. 7, 2024, 9:20 a.m. UTC | #1
On Wed, 06 Nov 2024, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Now that we have pps_units_to_msecs(), get_delay() looks
> rather pointless. Nuke it.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Reviewed-by: Jani Nikula <jani.nikula@intel.com>

> ---
>  drivers/gpu/drm/i915/display/intel_pps.c | 12 +++++-------
>  1 file changed, 5 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_pps.c b/drivers/gpu/drm/i915/display/intel_pps.c
> index 378a525eec16..173bcae5f0e2 100644
> --- a/drivers/gpu/drm/i915/display/intel_pps.c
> +++ b/drivers/gpu/drm/i915/display/intel_pps.c
> @@ -1560,13 +1560,11 @@ static void pps_init_delays(struct intel_dp *intel_dp)
>  	assign_final(power_cycle);
>  #undef assign_final
>  
> -#define get_delay(field)	pps_units_to_msecs(final->field)
> -	intel_dp->pps.panel_power_up_delay = get_delay(power_up);
> -	intel_dp->pps.backlight_on_delay = get_delay(backlight_on);
> -	intel_dp->pps.backlight_off_delay = get_delay(backlight_off);
> -	intel_dp->pps.panel_power_down_delay = get_delay(power_down);
> -	intel_dp->pps.panel_power_cycle_delay = get_delay(power_cycle);
> -#undef get_delay
> +	intel_dp->pps.panel_power_up_delay = pps_units_to_msecs(final->power_up);
> +	intel_dp->pps.backlight_on_delay = pps_units_to_msecs(final->backlight_on);
> +	intel_dp->pps.backlight_off_delay = pps_units_to_msecs(final->backlight_off);
> +	intel_dp->pps.panel_power_down_delay = pps_units_to_msecs(final->power_down);
> +	intel_dp->pps.panel_power_cycle_delay = pps_units_to_msecs(final->power_cycle);
>  
>  	drm_dbg_kms(display->drm,
>  		    "panel power up delay %d, power down delay %d, power cycle delay %d\n",
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_pps.c b/drivers/gpu/drm/i915/display/intel_pps.c
index 378a525eec16..173bcae5f0e2 100644
--- a/drivers/gpu/drm/i915/display/intel_pps.c
+++ b/drivers/gpu/drm/i915/display/intel_pps.c
@@ -1560,13 +1560,11 @@  static void pps_init_delays(struct intel_dp *intel_dp)
 	assign_final(power_cycle);
 #undef assign_final
 
-#define get_delay(field)	pps_units_to_msecs(final->field)
-	intel_dp->pps.panel_power_up_delay = get_delay(power_up);
-	intel_dp->pps.backlight_on_delay = get_delay(backlight_on);
-	intel_dp->pps.backlight_off_delay = get_delay(backlight_off);
-	intel_dp->pps.panel_power_down_delay = get_delay(power_down);
-	intel_dp->pps.panel_power_cycle_delay = get_delay(power_cycle);
-#undef get_delay
+	intel_dp->pps.panel_power_up_delay = pps_units_to_msecs(final->power_up);
+	intel_dp->pps.backlight_on_delay = pps_units_to_msecs(final->backlight_on);
+	intel_dp->pps.backlight_off_delay = pps_units_to_msecs(final->backlight_off);
+	intel_dp->pps.panel_power_down_delay = pps_units_to_msecs(final->power_down);
+	intel_dp->pps.panel_power_cycle_delay = pps_units_to_msecs(final->power_cycle);
 
 	drm_dbg_kms(display->drm,
 		    "panel power up delay %d, power down delay %d, power cycle delay %d\n",