All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Simplify onion for bxt_ddi_phy_init()
@ 2017-11-07 13:53 Chris Wilson
  2017-11-07 14:19 ` ✗ Fi.CI.BAT: warning for " Patchwork
  2017-11-07 16:23 ` [PATCH] " Gabriel Krisman Bertazi
  0 siblings, 2 replies; 4+ messages in thread
From: Chris Wilson @ 2017-11-07 13:53 UTC (permalink / raw)
  To: intel-gfx; +Cc: Ander Conselvan de Oliveira

Older compilers (gcc-4.9) are not as able to track uninitialised
variables as well as more recent compilers. In particular,

drivers/gpu/drm/i915/intel_dpio_phy.c: In function ‘bxt_ddi_phy_init’:
drivers/gpu/drm/i915/intel_dpio_phy.c:482:25: warning: ‘was_enabled’ may be used uninitialized in this function [-Wmaybe-uninitialized]

In this case, we can rearrange code slightly to make the control flow
clearer to the reader, as well as the compiler. That is we only call
uninit using the same predicate as calling init

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Cc: Imre Deak <imre.deak@intel.com>
---
 drivers/gpu/drm/i915/intel_dpio_phy.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_dpio_phy.c b/drivers/gpu/drm/i915/intel_dpio_phy.c
index 63b76eac018f..490a42d9a3e8 100644
--- a/drivers/gpu/drm/i915/intel_dpio_phy.c
+++ b/drivers/gpu/drm/i915/intel_dpio_phy.c
@@ -466,21 +466,21 @@ void bxt_ddi_phy_init(struct drm_i915_private *dev_priv, enum dpio_phy phy)
 
 	lockdep_assert_held(&dev_priv->power_domains.lock);
 
-	if (rcomp_phy != -1) {
+	was_enabled = true;
+	if (rcomp_phy != -1)
 		was_enabled = bxt_ddi_phy_is_enabled(dev_priv, rcomp_phy);
 
-		/*
-		 * We need to copy the GRC calibration value from rcomp_phy,
-		 * so make sure it's powered up.
-		 */
-		if (!was_enabled)
-			_bxt_ddi_phy_init(dev_priv, rcomp_phy);
-	}
+	/*
+	 * We need to copy the GRC calibration value from rcomp_phy,
+	 * so make sure it's powered up.
+	 */
+	if (!was_enabled)
+		_bxt_ddi_phy_init(dev_priv, rcomp_phy);
 
 	_bxt_ddi_phy_init(dev_priv, phy);
 
-	if (rcomp_phy != -1 && !was_enabled)
-		bxt_ddi_phy_uninit(dev_priv, phy_info->rcomp_phy);
+	if (!was_enabled)
+		bxt_ddi_phy_uninit(dev_priv, rcomp_phy);
 }
 
 static bool __printf(6, 7)
-- 
2.15.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* ✗ Fi.CI.BAT: warning for drm/i915: Simplify onion for bxt_ddi_phy_init()
  2017-11-07 13:53 [PATCH] drm/i915: Simplify onion for bxt_ddi_phy_init() Chris Wilson
@ 2017-11-07 14:19 ` Patchwork
  2017-11-07 16:23 ` [PATCH] " Gabriel Krisman Bertazi
  1 sibling, 0 replies; 4+ messages in thread
From: Patchwork @ 2017-11-07 14:19 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Simplify onion for bxt_ddi_phy_init()
URL   : https://patchwork.freedesktop.org/series/33345/
State : warning

== Summary ==

Series 33345v1 drm/i915: Simplify onion for bxt_ddi_phy_init()
https://patchwork.freedesktop.org/api/1.0/series/33345/revisions/1/mbox/

Test core_auth:
        Subgroup basic-auth:
                dmesg-warn -> PASS       (fi-bsw-n3050) fdo#103479 +1
Test gem_ringfill:
        Subgroup basic-default:
                pass       -> SKIP       (fi-bsw-n3050)
Test gem_sync:
        Subgroup basic-store-all:
                fail       -> PASS       (fi-ivb-3520m) fdo#100007
Test kms_pipe_crc_basic:
        Subgroup nonblocking-crc-pipe-a-frame-sequence:
                pass       -> SKIP       (fi-hsw-4770r)

fdo#103479 https://bugs.freedesktop.org/show_bug.cgi?id=103479
fdo#100007 https://bugs.freedesktop.org/show_bug.cgi?id=100007

fi-bdw-5557u     total:289  pass:268  dwarn:0   dfail:0   fail:0   skip:21  time:451s
fi-bdw-gvtdvm    total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:458s
fi-blb-e6850     total:289  pass:223  dwarn:1   dfail:0   fail:0   skip:65  time:382s
fi-bsw-n3050     total:289  pass:242  dwarn:0   dfail:0   fail:0   skip:47  time:545s
fi-bwr-2160      total:289  pass:183  dwarn:0   dfail:0   fail:0   skip:106 time:275s
fi-bxt-dsi       total:289  pass:259  dwarn:0   dfail:0   fail:0   skip:30  time:510s
fi-bxt-j4205     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:502s
fi-byt-j1900     total:289  pass:253  dwarn:1   dfail:0   fail:0   skip:35  time:507s
fi-byt-n2820     total:289  pass:249  dwarn:1   dfail:0   fail:0   skip:39  time:487s
fi-cfl-s         total:289  pass:254  dwarn:3   dfail:0   fail:0   skip:32  time:553s
fi-cnl-y         total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:607s
fi-elk-e7500     total:289  pass:229  dwarn:0   dfail:0   fail:0   skip:60  time:433s
fi-gdg-551       total:289  pass:178  dwarn:1   dfail:0   fail:1   skip:109 time:259s
fi-glk-1         total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:589s
fi-glk-dsi       total:289  pass:258  dwarn:0   dfail:0   fail:1   skip:30  time:494s
fi-hsw-4770      total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:431s
fi-hsw-4770r     total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:432s
fi-ilk-650       total:289  pass:228  dwarn:0   dfail:0   fail:0   skip:61  time:425s
fi-ivb-3520m     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:506s
fi-ivb-3770      total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:464s
fi-kbl-7500u     total:289  pass:264  dwarn:1   dfail:0   fail:0   skip:24  time:496s
fi-kbl-7560u     total:289  pass:270  dwarn:0   dfail:0   fail:0   skip:19  time:577s
fi-kbl-7567u     total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:482s
fi-kbl-r         total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:585s
fi-pnv-d510      total:289  pass:222  dwarn:1   dfail:0   fail:0   skip:66  time:572s
fi-skl-6260u     total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:448s
fi-skl-6600u     total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:599s
fi-skl-6700hq    total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:649s
fi-skl-6700k     total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:517s
fi-skl-6770hq    total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:508s
fi-skl-gvtdvm    total:289  pass:266  dwarn:0   dfail:0   fail:0   skip:23  time:456s
fi-snb-2520m     total:289  pass:250  dwarn:0   dfail:0   fail:0   skip:39  time:576s
fi-snb-2600      total:289  pass:249  dwarn:0   dfail:0   fail:0   skip:40  time:417s

b911f67a17e5eef16d49a51b83f7da12666e3be6 drm-tip: 2017y-11m-07d-11h-11m-37s UTC integration manifest
fd4128d2056e drm/i915: Simplify onion for bxt_ddi_phy_init()

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_6990/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/i915: Simplify onion for bxt_ddi_phy_init()
  2017-11-07 13:53 [PATCH] drm/i915: Simplify onion for bxt_ddi_phy_init() Chris Wilson
  2017-11-07 14:19 ` ✗ Fi.CI.BAT: warning for " Patchwork
@ 2017-11-07 16:23 ` Gabriel Krisman Bertazi
  2017-11-07 20:24   ` Chris Wilson
  1 sibling, 1 reply; 4+ messages in thread
From: Gabriel Krisman Bertazi @ 2017-11-07 16:23 UTC (permalink / raw)
  To: Chris Wilson; +Cc: Ander Conselvan de Oliveira, intel-gfx

Chris Wilson <chris@chris-wilson.co.uk> writes:

> Older compilers (gcc-4.9) are not as able to track uninitialised
> variables as well as more recent compilers. In particular,
>
> drivers/gpu/drm/i915/intel_dpio_phy.c: In function ‘bxt_ddi_phy_init’:
> drivers/gpu/drm/i915/intel_dpio_phy.c:482:25: warning: ‘was_enabled’ may be used uninitialized in this function [-Wmaybe-uninitialized]
>
> In this case, we can rearrange code slightly to make the control flow
> clearer to the reader, as well as the compiler. That is we only call
> uninit using the same predicate as calling init
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
> Cc: Imre Deak <imre.deak@intel.com>


Reviewed-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk>

-- 
Gabriel Krisman Bertazi
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/i915: Simplify onion for bxt_ddi_phy_init()
  2017-11-07 16:23 ` [PATCH] " Gabriel Krisman Bertazi
@ 2017-11-07 20:24   ` Chris Wilson
  0 siblings, 0 replies; 4+ messages in thread
From: Chris Wilson @ 2017-11-07 20:24 UTC (permalink / raw)
  To: Gabriel Krisman Bertazi; +Cc: Ander Conselvan de Oliveira, intel-gfx

Quoting Gabriel Krisman Bertazi (2017-11-07 16:23:59)
> Chris Wilson <chris@chris-wilson.co.uk> writes:
> 
> > Older compilers (gcc-4.9) are not as able to track uninitialised
> > variables as well as more recent compilers. In particular,
> >
> > drivers/gpu/drm/i915/intel_dpio_phy.c: In function ‘bxt_ddi_phy_init’:
> > drivers/gpu/drm/i915/intel_dpio_phy.c:482:25: warning: ‘was_enabled’ may be used uninitialized in this function [-Wmaybe-uninitialized]
> >
> > In this case, we can rearrange code slightly to make the control flow
> > clearer to the reader, as well as the compiler. That is we only call
> > uninit using the same predicate as calling init
> >
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
> > Cc: Imre Deak <imre.deak@intel.com>
> 
> 
> Reviewed-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk>

Thanks for the review, pushed.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-11-07 20:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-07 13:53 [PATCH] drm/i915: Simplify onion for bxt_ddi_phy_init() Chris Wilson
2017-11-07 14:19 ` ✗ Fi.CI.BAT: warning for " Patchwork
2017-11-07 16:23 ` [PATCH] " Gabriel Krisman Bertazi
2017-11-07 20:24   ` Chris Wilson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.