* [patch] drm/i915: return false on failure in intel_dp_compute_config()
@ 2017-02-23 10:39 Dan Carpenter
2017-02-23 11:09 ` [Intel-gfx] " Joonas Lahtinen
0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2017-02-23 10:39 UTC (permalink / raw)
To: Daniel Vetter, Chandra Konduru; +Cc: intel-gfx, kernel-janitors, dri-devel
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")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index d1670b8afbf5..9173548ba601 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -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))
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Intel-gfx] [patch] drm/i915: return false on failure in intel_dp_compute_config()
2017-02-23 10:39 [patch] drm/i915: return false on failure in intel_dp_compute_config() Dan Carpenter
@ 2017-02-23 11:09 ` Joonas Lahtinen
2017-02-23 11:20 ` Dan Carpenter
0 siblings, 1 reply; 3+ messages in thread
From: Joonas Lahtinen @ 2017-02-23 11:09 UTC (permalink / raw)
To: Dan Carpenter, Daniel Vetter, Chandra Konduru
Cc: David Airlie, intel-gfx, kernel-janitors, dri-devel
On to, 2017-02-23 at 13:39 +0300, Dan Carpenter wrote:
> 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")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
<SNIP>
>
> @@ -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;
> }
You can drop the braces, too.
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Regards, Joonas
--
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Intel-gfx] [patch] drm/i915: return false on failure in intel_dp_compute_config()
2017-02-23 11:09 ` [Intel-gfx] " Joonas Lahtinen
@ 2017-02-23 11:20 ` Dan Carpenter
0 siblings, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2017-02-23 11:20 UTC (permalink / raw)
To: Joonas Lahtinen
Cc: David Airlie, intel-gfx, kernel-janitors, dri-devel,
Daniel Vetter
On Thu, Feb 23, 2017 at 01:09:14PM +0200, Joonas Lahtinen wrote:
> On to, 2017-02-23 at 13:39 +0300, Dan Carpenter wrote:
> > 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")
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> <SNIP>
>
> >
> > @@ -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;
> > }
>
> You can drop the braces, too.
>
Multi-line indents get braces for readability.
regards,
dan carpenter
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-02-23 11:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-23 10:39 [patch] drm/i915: return false on failure in intel_dp_compute_config() Dan Carpenter
2017-02-23 11:09 ` [Intel-gfx] " Joonas Lahtinen
2017-02-23 11:20 ` Dan Carpenter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox