Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/external/bsd/drm2/dist/drm/i915 Limit scope of ret and o...
details: https://anonhg.NetBSD.org/src/rev/c4eac6e62e8f
branches: trunk
changeset: 336359:c4eac6e62e8f
user: riastradh <riastradh%NetBSD.org@localhost>
date: Fri Feb 27 04:29:27 2015 +0000
description:
Limit scope of ret and omit needless use of it to reduce confusion.
diffstat:
sys/external/bsd/drm2/dist/drm/i915/intel_i2c.c | 10 +++-------
1 files changed, 3 insertions(+), 7 deletions(-)
diffs (33 lines):
diff -r 3244b367e903 -r c4eac6e62e8f sys/external/bsd/drm2/dist/drm/i915/intel_i2c.c
--- a/sys/external/bsd/drm2/dist/drm/i915/intel_i2c.c Fri Feb 27 01:52:15 2015 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/intel_i2c.c Fri Feb 27 04:29:27 2015 +0000
@@ -269,9 +269,7 @@
#endif
int reg_offset = dev_priv->gpio_mmio_base;
u32 gmbus2 = 0;
-#ifdef __NetBSD__
- int ret;
-#else
+#ifndef __NetBSD__
DEFINE_WAIT(wait);
#endif
@@ -292,16 +290,14 @@
spin_lock(&dev_priv->gmbus_wait_lock);
if (cold) {
unsigned timo = 1000;
- ret = 0;
while (gmbus2 = I915_READ_NOTRACE(GMBUS2 + reg_offset),
!ISSET(gmbus2, (GMBUS_SATOER | gmbus2_status))) {
- if (timo-- == 0) {
- ret = -ETIMEDOUT;
+ if (timo-- == 0)
break;
- }
DELAY(100);
}
} else {
+ int ret;
DRM_SPIN_TIMED_WAIT_UNTIL(ret, &dev_priv->gmbus_wait_queue,
&dev_priv->gmbus_wait_lock, 1,
(gmbus2 = I915_READ_NOTRACE(GMBUS2 + reg_offset),
Home |
Main Index |
Thread Index |
Old Index