Skip to contentSkip to conversation

drm/i915/lvds: Remove dead code from failing case

PATCH Applied Damien Lespiau 3 participants 3 messages Feb 13, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915/lvds: Remove dead code from failing case

Coverity points out that, if we end up in the 'failed' label, that's precisely because we couldn't retrieve a fixed mode (ie fixed_mode is NULL) and then "if (fixed_mode)" is always false.

Remove that dead code.

---
 drivers/gpu/drm/i915/intel_lvds.c | 2 --
 1 file changed, 2 deletions(-)
drivers/gpu/drm/i915/intel_lvds.c +0 -2
index 6341a88..3984608 100644
@@ -1125,8 +1125,6 @@ failed:
 	DRM_DEBUG_KMS("No LVDS modes found, disabling.\n");
 	drm_connector_cleanup(connector);
 	drm_encoder_cleanup(encoder);
-	if (fixed_mode)
-		drm_mode_destroy(dev, fixed_mode);
 	kfree(lvds_encoder);
 	kfree(lvds_connector);
 	return;
Signature · 1 line
1.8.3.1
Reviewed-by on v1 1/1
#1 lore raw

2014-02-13 16:56 GMT-02:00 Damien Lespiau <[email protected]>:

Quoted 7 lines

Coverity points out that, if we end up in the 'failed' label, that's precisely because we couldn't retrieve a fixed mode (ie fixed_mode is NULL) and then "if (fixed_mode)" is always false.

Remove that dead code.

Quoted 24 lines
---
 drivers/gpu/drm/i915/intel_lvds.c | 2 --
 1 file changed, 2 deletions(-)
drivers/gpu/drm/i915/intel_lvds.c +0 -3
index 6341a88..3984608 100644
@@ -1125,8 +1125,6 @@ failed:
        DRM_DEBUG_KMS("No LVDS modes found, disabling.\n");
        drm_connector_cleanup(connector);
        drm_encoder_cleanup(encoder);
-       if (fixed_mode)
-               drm_mode_destroy(dev, fixed_mode);
        kfree(lvds_encoder);
        kfree(lvds_connector);
        return;
--

1.8.3.1

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Signature · 1 line
Paulo Zanoni
#2 lore raw
Quoted 10 lines · Paulo Zanoni

2014-02-13 16:56 GMT-02:00 Damien Lespiau <[email protected]>:

Quoted 7 lines

Coverity points out that, if we end up in the 'failed' label, that's precisely because we couldn't retrieve a fixed mode (ie fixed_mode is NULL) and then "if (fixed_mode)" is always false.

Remove that dead code.

Queued for -next, thanks for the patch.
-Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch