All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: David Airlie <airlied@linux.ie>
Cc: Eric Anholt <eric@anholt.net>,
	Jesse Barnes <jbarnes@virtuousgeek.org>,
	Zhenyu Wang <zhenyuw@linux.intel.com>,
	Zhao Yakui <yakui.zhao@intel.com>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: Re: [patch] i915: remove unneed NULL checks
Date: Mon, 23 Aug 2010 11:28:28 +0000	[thread overview]
Message-ID: <20100823112828.GK6674@bicker> (raw)
In-Reply-To: <20100623170426.GB15424@bicker>

On Wed, Jun 23, 2010 at 07:06:22PM +0200, Dan Carpenter wrote:
> We don't need to check the list cursor in a list_for_each_entry().  It's
> always non-null.
> 

Here is another one that never got applied.  I has a sad face.  :(

regards,
dan carpenter

> Signed-off-by: Dan Carpenter <error27@gmail.com>
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index cc8131f..8a2bdfc 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -745,7 +745,7 @@ bool intel_pipe_has_type (struct drm_crtc *crtc, int type)
>      struct drm_encoder *l_entry;
>  
>      list_for_each_entry(l_entry, &mode_config->encoder_list, head) {
> -	    if (l_entry && l_entry->crtc = crtc) {
> +	    if (l_entry->crtc = crtc) {
>  		    struct intel_encoder *intel_encoder = enc_to_intel_encoder(l_entry);
>  		    if (intel_encoder->type = type)
>  			    return true;
> @@ -3322,7 +3322,7 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc,
>  
>  	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);

WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <error27@gmail.com>
To: David Airlie <airlied@linux.ie>
Cc: Eric Anholt <eric@anholt.net>,
	Jesse Barnes <jbarnes@virtuousgeek.org>,
	Zhenyu Wang <zhenyuw@linux.intel.com>,
	Zhao Yakui <yakui.zhao@intel.com>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: Re: [patch] i915: remove unneed NULL checks
Date: Mon, 23 Aug 2010 13:28:28 +0200	[thread overview]
Message-ID: <20100823112828.GK6674@bicker> (raw)
In-Reply-To: <20100623170426.GB15424@bicker>

On Wed, Jun 23, 2010 at 07:06:22PM +0200, Dan Carpenter wrote:
> We don't need to check the list cursor in a list_for_each_entry().  It's
> always non-null.
> 

Here is another one that never got applied.  I has a sad face.  :(

regards,
dan carpenter

> Signed-off-by: Dan Carpenter <error27@gmail.com>
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index cc8131f..8a2bdfc 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -745,7 +745,7 @@ bool intel_pipe_has_type (struct drm_crtc *crtc, int type)
>      struct drm_encoder *l_entry;
>  
>      list_for_each_entry(l_entry, &mode_config->encoder_list, head) {
> -	    if (l_entry && l_entry->crtc == crtc) {
> +	    if (l_entry->crtc == crtc) {
>  		    struct intel_encoder *intel_encoder = enc_to_intel_encoder(l_entry);
>  		    if (intel_encoder->type == type)
>  			    return true;
> @@ -3322,7 +3322,7 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc,
>  
>  	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);

  reply	other threads:[~2010-08-23 11:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-23 17:06 [patch] i915: remove unneed NULL checks Dan Carpenter
2010-08-23 11:28 ` Dan Carpenter [this message]
2010-08-23 11:28   ` Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100823112828.GK6674@bicker \
    --to=error27@gmail.com \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=eric@anholt.net \
    --cc=jbarnes@virtuousgeek.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=yakui.zhao@intel.com \
    --cc=zhenyuw@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.