i915: remove unneeded null checks
authorDan Carpenter <error27@gmail.com>
Fri, 7 May 2010 08:39:00 +0000 (10:39 +0200)
committerEric Anholt <eric@anholt.net>
Wed, 26 May 2010 21:16:52 +0000 (14:16 -0700)
The "encoder" variable can never be null because it is used as loop
cursor in a list_for_each_entry() loop.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
drivers/gpu/drm/i915/intel_dp.c

index 0a11c657c9497369e25d13aa8a905297fc338fcd..49b54f05d3cfcb767b28c0caecc8523ea6deabed 100644 (file)
@@ -576,7 +576,7 @@ intel_dp_set_m_n(struct drm_crtc *crtc, struct drm_display_mode *mode,
                struct intel_encoder *intel_encoder;
                struct intel_dp_priv *dp_priv;
 
-               if (!encoder || encoder->crtc != crtc)
+               if (encoder->crtc != crtc)
                        continue;
 
                intel_encoder = enc_to_intel_encoder(encoder);
@@ -1353,7 +1353,7 @@ intel_trans_dp_port_sel (struct drm_crtc *crtc)
        struct intel_encoder *intel_encoder = NULL;
 
        list_for_each_entry(encoder, &mode_config->encoder_list, head) {
-               if (!encoder || encoder->crtc != crtc)
+               if (encoder->crtc != crtc)
                        continue;
 
                intel_encoder = enc_to_intel_encoder(encoder);