diff mbox

drm/i915: Remove pointless if-else from sdvo code

Message ID 20180621174658.18823-1-ville.syrjala@linux.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ville Syrjälä June 21, 2018, 5:46 p.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

The return value is a bool so we can just return the result of
the biwise AND. The compiler will take care of the rest.

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

Comments

Chris Wilson June 21, 2018, 7:50 p.m. UTC | #1
Quoting Ville Syrjala (2018-06-21 18:46:58)
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> The return value is a bool so we can just return the result of
> the biwise AND. The compiler will take care of the rest.
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c
index e6a64b3ecd91..c7f95c958660 100644
--- a/drivers/gpu/drm/i915/intel_sdvo.c
+++ b/drivers/gpu/drm/i915/intel_sdvo.c
@@ -1400,10 +1400,7 @@  static bool intel_sdvo_connector_get_hw_state(struct intel_connector *connector)
 
 	intel_sdvo_get_active_outputs(intel_sdvo, &active_outputs);
 
-	if (active_outputs & intel_sdvo_connector->output_flag)
-		return true;
-	else
-		return false;
+	return active_outputs & intel_sdvo_connector->output_flag;
 }
 
 bool intel_sdvo_port_enabled(struct drm_i915_private *dev_priv,