diff mbox series

[2/3] drm/i915/display: use clk_off name to avoid double negation

Message ID 20191206071422.27138-2-lucas.demarchi@intel.com (mailing list archive)
State New, archived
Headers show
Series [1/3] drm/i915/display: move clk off sanitize to its own function | expand

Commit Message

Lucas De Marchi Dec. 6, 2019, 7:14 a.m. UTC
Instead of "ungated" use the same name for the variable as the bitfield,
making it clearer what's the intent of the checks.

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
---
 drivers/gpu/drm/i915/display/intel_ddi.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

Comments

Taylor, Clinton A Dec. 11, 2019, 8:25 p.m. UTC | #1
On 12/5/19 11:14 PM, Lucas De Marchi wrote:
> Instead of "ungated" use the same name for the variable as the bitfield,
> making it clearer what's the intent of the checks.
>
> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
> ---
>   drivers/gpu/drm/i915/display/intel_ddi.c | 8 +++-----
>   1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
> index 3433b0bf4f44..586a0019b9c7 100644
> --- a/drivers/gpu/drm/i915/display/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/display/intel_ddi.c
> @@ -3012,12 +3012,10 @@ static void icl_sanitize_port_clk_off(struct drm_i915_private *dev_priv,
>   	val = I915_READ(ICL_DPCLKA_CFGCR0);
>   	for_each_port_masked(port, port_mask) {
>   		enum phy phy = intel_port_to_phy(dev_priv, port);
> +		bool ddi_clk_off = val & icl_dpclka_cfgcr0_clk_off(dev_priv,
> +								   phy);
>   
> -		bool ddi_clk_ungated = !(val &
> -					 icl_dpclka_cfgcr0_clk_off(dev_priv,
> -								   phy));
> -
> -		if (ddi_clk_needed == ddi_clk_ungated)
> +		if (ddi_clk_needed == !ddi_clk_off)
>   			continue;
>   
>   		/*

Sanity prevails.

Reviewed-by: Clint Taylor

-Clint
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c
index 3433b0bf4f44..586a0019b9c7 100644
--- a/drivers/gpu/drm/i915/display/intel_ddi.c
+++ b/drivers/gpu/drm/i915/display/intel_ddi.c
@@ -3012,12 +3012,10 @@  static void icl_sanitize_port_clk_off(struct drm_i915_private *dev_priv,
 	val = I915_READ(ICL_DPCLKA_CFGCR0);
 	for_each_port_masked(port, port_mask) {
 		enum phy phy = intel_port_to_phy(dev_priv, port);
+		bool ddi_clk_off = val & icl_dpclka_cfgcr0_clk_off(dev_priv,
+								   phy);
 
-		bool ddi_clk_ungated = !(val &
-					 icl_dpclka_cfgcr0_clk_off(dev_priv,
-								   phy));
-
-		if (ddi_clk_needed == ddi_clk_ungated)
+		if (ddi_clk_needed == !ddi_clk_off)
 			continue;
 
 		/*