From: Dan Carpenter Date: Mon, 20 Dec 2010 09:26:26 +0000 (+0300) Subject: drm/nouveau: sizeof() vs ARRAY_SIZE() X-Git-Tag: v2.6.38-rc1~24^2~4^2~35 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d095e23206e6291cbde4b2937d1316a42d9e6440;p=platform%2Fupstream%2Fkernel-adaptation-pc.git drm/nouveau: sizeof() vs ARRAY_SIZE() ARRAY_SIZE() was intended here, sizeof() is too large. Signed-off-by: Dan Carpenter Signed-off-by: Ben Skeggs --- 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; }