i915: remove unneeded null checks

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Tuesday, June 1, 2010 - 2:59 pm

Gitweb:     http://git.kernel.org/linus/d8201ab6514f8dc1a0ccfac52c688d80976a425a
Commit:     d8201ab6514f8dc1a0ccfac52c688d80976a425a
Parent:     90a78e8f60f679b0937011314a6cda39c7449d1d
Author:     Dan Carpenter <error27@gmail.com>
AuthorDate: Fri May 7 10:39:00 2010 +0200
Committer:  Eric Anholt <eric@anholt.net>
CommitDate: Wed May 26 14:16:52 2010 -0700

    i915: remove unneeded null checks
    
    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 |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 0a11c65..49b54f0 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -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);
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
i915: remove unneeded null checks, Linux Kernel Mailing ..., (Tue Jun 1, 2:59 pm)