Module Name:    src
Committed By:   riastradh
Date:           Fri Feb 27 04:29:27 UTC 2015

Modified Files:
        src/sys/external/bsd/drm2/dist/drm/i915: intel_i2c.c

Log Message:
Limit scope of ret and omit needless use of it to reduce confusion.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/external/bsd/drm2/dist/drm/i915/intel_i2c.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/i915/intel_i2c.c
diff -u src/sys/external/bsd/drm2/dist/drm/i915/intel_i2c.c:1.4 src/sys/external/bsd/drm2/dist/drm/i915/intel_i2c.c:1.5
--- src/sys/external/bsd/drm2/dist/drm/i915/intel_i2c.c:1.4	Wed Jul 16 20:56:25 2014
+++ src/sys/external/bsd/drm2/dist/drm/i915/intel_i2c.c	Fri Feb 27 04:29:27 2015
@@ -269,9 +269,7 @@ gmbus_wait_hw_status(struct drm_i915_pri
 #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 @@ gmbus_wait_hw_status(struct drm_i915_pri
 	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),

Reply via email to