From patchwork Mon Dec 20 09:26:26 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 419501 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oBK9QutU024667 for ; Mon, 20 Dec 2010 09:27:19 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3B3439EB1D for ; Mon, 20 Dec 2010 01:26:56 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ww0-f43.google.com (mail-ww0-f43.google.com [74.125.82.43]) by gabe.freedesktop.org (Postfix) with ESMTP id 86ACA9E7F2 for ; Mon, 20 Dec 2010 01:26:47 -0800 (PST) Received: by wwi17 with SMTP id 17so2565686wwi.12 for ; Mon, 20 Dec 2010 01:26:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:mime-version:content-type:content-disposition:user-agent; bh=fGOiCwmVX20iyPVIWIMQTwLV7S033dWEq8qZqkUq7sg=; b=qZ4aq6NN0ay+3QyioK7HqKQCH7mKl1xGKriv43OSizO9s7sYUOsnSD/Qj1HejA2y3z a90FcFsF7BUq8PAZ9gcCIC8GI8owXZ90IXdr7WgAjz2ND6Fpi27tdCi1nlfH3d7dXkGY XLkLrRZ8UiFdXlWLHkZVns0N43D2Vq5oFYf0Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; b=V5/Yz9LMYergp+8KtSsbgGwpae5wZoFRerjGWB6++5RezXdtP54EGVYa4BycUqyKKp 8+HUBA7D434t9cGthhdkIcPNT0DcwzqlBv8FClbzdBvIWeTpYmeMg8tX7pBpGSGkof+0 AH1stwpUzlanyhtabiR5SqWIrbs2oieNDBy4A= Received: by 10.227.165.6 with SMTP id g6mr2414743wby.181.1292837206559; Mon, 20 Dec 2010 01:26:46 -0800 (PST) Received: from bicker (h14ba.n2.ips.mtn.co.ug [212.88.116.186]) by mx.google.com with ESMTPS id m10sm2525298wbc.4.2010.12.20.01.26.35 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 20 Dec 2010 01:26:45 -0800 (PST) Date: Mon, 20 Dec 2010 12:26:26 +0300 From: Dan Carpenter To: David Airlie Subject: [patch -next] nouveua: sizeof() vs ARRAY_SIZE() Message-ID: <20101220092626.GT1936@bicker> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) Cc: kernel-janitors@vger.kernel.org, Ben Skeggs , dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Mon, 20 Dec 2010 09:27:20 +0000 (UTC) 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; }