Skip to contentSkip to conversation

i915: Remove silly test

PATCH In review Alan Cox 2 participants 2 messages Jul 25, 2012 – Jul 26, 2012

Subsystems (2)
lore
Share & tools
lore

Alan Cox

author
#0 lore raw

PATCH 1/1 i915: Remove silly test

From: Alan Cox <[email protected]>

drv_priv->gmbus is an array. Comparing it with NULL is somewhat less useful than a chocolate teapot.

Possibly we should be testing bus != NULL each iteration of the loop instead ?

gcc could help by warning too!

---

 drivers/gpu/drm/i915/intel_i2c.c |    3 ---
 1 file changed, 3 deletions(-)
drivers/gpu/drm/i915/intel_i2c.c +0 -3
index 1991a44..d79500b 100644
@@ -540,9 +540,6 @@ void intel_teardown_gmbus(struct drm_device *dev)
 	struct drm_i915_private *dev_priv = dev->dev_private;
 	int i;
 
-	if (dev_priv->gmbus == NULL)
-		return;
-
 	for (i = 0; i < GMBUS_NUM_PORTS; i++) {
 		struct intel_gmbus *bus = &dev_priv->gmbus[i];
 		i2c_del_adapter(&bus->adapter);
#1 lore raw
Quoted 11 lines · Alan Cox

From: Alan Cox <[email protected]>

drv_priv->gmbus is an array. Comparing it with NULL is somewhat less useful than a chocolate teapot.

Possibly we should be testing bus != NULL each iteration of the loop instead ?

gcc could help by warning too!

All three patches merged for -fixes, thanks.
-Daniel

Signature · 3 lines
Daniel Vetter
Mail: [email protected]
Mobile: +41 (0)79 365 57 48