public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Ben Skeggs <bskeggs@redhat.com>
To: Dan Carpenter <error27@gmail.com>
Cc: kernel-janitors@vger.kernel.org, dri-devel@lists.freedesktop.org
Subject: Re: [patch -next] nouveua: sizeof() vs ARRAY_SIZE()
Date: Tue, 21 Dec 2010 01:12:33 +0000	[thread overview]
Message-ID: <1292893956.2214.14.camel@nisroch> (raw)
In-Reply-To: <20101220092626.GT1936@bicker>

On Mon, 2010-12-20 at 12:26 +0300, Dan Carpenter wrote:
> ARRAY_SIZE() was intended here, sizeof() is too large.
Thanks, I've queued this patch.

Ben.
> 
> Signed-off-by: Dan Carpenter <error27@gmail.com>
> 
> diff --git a/drivers/gpu/drm/nouveau/nv50_vram.c b/drivers/gpu/drm/nouveau/nv50_vram.c
> index 47489ed..58e98ad 100644
> --- a/drivers/gpu/drm/nouveau/nv50_vram.c
> +++ b/drivers/gpu/drm/nouveau/nv50_vram.c
> @@ -42,7 +42,7 @@ nv50_vram_flags_valid(struct drm_device *dev, u32 tile_flags)
>  {
>  	int type = (tile_flags & NOUVEAU_GEM_TILE_LAYOUT_MASK) >> 8;
>  
> -	if (likely(type < sizeof(types) && types[type]))
> +	if (likely(type < ARRAY_SIZE(types) && types[type]))
>  		return true;
>  	return false;
>  }



      reply	other threads:[~2010-12-21  1:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-20  9:26 [patch -next] nouveua: sizeof() vs ARRAY_SIZE() Dan Carpenter
2010-12-21  1:12 ` Ben Skeggs [this message]

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=1292893956.2214.14.camel@nisroch \
    --to=bskeggs@redhat.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=error27@gmail.com \
    --cc=kernel-janitors@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox