Skip to content

Commit

Permalink
drm/nouveau: sizeof() vs ARRAY_SIZE()
Browse files Browse the repository at this point in the history
ARRAY_SIZE() was intended here, sizeof() is too large.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
  • Loading branch information
Dan Carpenter authored and Ben Skeggs committed Dec 21, 2010
1 parent b08ebe7 commit d095e23
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/nouveau/nv50_vram.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit d095e23

Please sign in to comment.