From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH 1/2] drm/i915: [dinq] Fix six instances of -Warray-bounds Date: Wed, 15 Feb 2012 14:57:00 +0100 Message-ID: <20120215135700.GE4095@phenom.ffwll.local> References: <1329313363-25571-1-git-send-email-ben@bwidawsk.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-we0-f177.google.com (mail-we0-f177.google.com [74.125.82.177]) by gabe.freedesktop.org (Postfix) with ESMTP id 97CC8A0A46 for ; Wed, 15 Feb 2012 05:56:45 -0800 (PST) Received: by wera10 with SMTP id a10so795335wer.36 for ; Wed, 15 Feb 2012 05:56:44 -0800 (PST) Content-Disposition: inline In-Reply-To: <1329313363-25571-1-git-send-email-ben@bwidawsk.net> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: Ben Widawsky Cc: Daniel Vetter , intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Wed, Feb 15, 2012 at 02:42:42PM +0100, Ben Widawsky wrote: > Introduced in commits c1cd90ed and d27b1e0e > > Cc: Daniel Vetter > Signed-off-by: Ben Widawsky This one smells like gcc being stupid - it's in a static function an gcc sees all the callsites and we only pass in a const ring argument. I'll drop that one. The other one is a bit more fishy, but we do check args->size == 0 before calling into these functions, so we will execute the loop at least once and hence is guaranteed to be initialized. It's harder to check, so gcc has a point here. But this code is scheduled to get completely rewritten anyway, so I'll drop this one, too. I'll re-send the new code in a few days or so. Cheers, Daniel -- Daniel Vetter Mail: daniel@ffwll.ch Mobile: +41 (0)79 365 57 48