Skip to contentSkip to conversation

drm/i915: return false on failure in intel_dp_compute_config()

PATCH In review Dan Carpenter 2 participants 3 messages Feb 23, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915: return false on failure in intel_dp_compute_config()

This function is a bool type where we are supposed to return false on failure and true on success. Negative error codes are currently treated as true.

Fixes a1b2278e4dfc ("drm/i915: skylake panel fitting using shared scalers")
drivers/gpu/drm/i915/intel_dp.c +2 -4
index d1670b8afbf5..9173548ba601 100644
@@ -1637,10 +1637,8 @@ intel_dp_compute_config(struct intel_encoder *encoder,
 				       adjusted_mode);
 
 		if (INTEL_GEN(dev_priv) >= 9) {
-			int ret;
-			ret = skl_update_scaler_crtc(pipe_config);
-			if (ret)
-				return ret;
+			if (skl_update_scaler_crtc(pipe_config))
+				return false;
 		}
 
 		if (HAS_GMCH_DISPLAY(dev_priv))

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Dan Carpenter

This function is a bool type where we are supposed to return false on failure and true on success.  Negative error codes are currently treated as true.

Fixes a1b2278e4dfc ("drm/i915: skylake panel fitting using shared scalers")

<SNIP>

Quoted 11 lines
drivers/gpu/drm/i915/intel_dp.c +0 -0
@@ -1637,10 +1637,8 @@ intel_dp_compute_config(struct intel_encoder *encoder,
  				       adjusted_mode);


  if (INTEL_GEN(dev_priv) >= 9) {

drivers/gpu/drm/i915/intel_dp.c +2 -4
-			int ret;
-			ret = skl_update_scaler_crtc(pipe_config);
-			if (ret)
-				return ret;
+			if (skl_update_scaler_crtc(pipe_config))
+				return false;
Quoted 1 line

  }

You can drop the braces, too.

Regards, Joonas

Signature · 7 lines
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#2 lore raw
Quoted 11 lines · Joonas Lahtinen
Quoted 6 lines · Dan Carpenter

This function is a bool type where we are supposed to return false on failure and true on success.  Negative error codes are currently treated as true.

Fixes a1b2278e4dfc ("drm/i915: skylake panel fitting using shared scalers")

<SNIP>

Quoted 1 line
Quoted 14 lines
Quoted 11 lines
drivers/gpu/drm/i915/intel_dp.c +0 -0
@@ -1637,10 +1637,8 @@ intel_dp_compute_config(struct intel_encoder *encoder,
  				       adjusted_mode);


  if (INTEL_GEN(dev_priv) >= 9) {

drivers/gpu/drm/i915/intel_dp.c +2 -4
-			int ret;
-			ret = skl_update_scaler_crtc(pipe_config);
-			if (ret)
-				return ret;
+			if (skl_update_scaler_crtc(pipe_config))
+				return false;

  }

You can drop the braces, too.

Multi-line indents get braces for readability.

regards,
dan carpenter

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx