From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hans Verkuil Subject: Re: sparse: ARRAY_SIZE and sparse array initialization Date: Sun, 30 Mar 2014 19:03:48 +0200 Message-ID: <53384E74.1050307@xs4all.nl> References: <532442E2.7050206@xs4all.nl> <532443AB.9080105@xs4all.nl> <533553E6.3060508@xs4all.nl> <533807FC.5050008@xs4all.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Sender: linux-media-owner@vger.kernel.org To: Linus Torvalds Cc: Christopher Li , Linux-Sparse , Linux Media Mailing List List-Id: linux-sparse@vger.kernel.org On 03/30/2014 06:48 PM, Linus Torvalds wrote: > On Sun, Mar 30, 2014 at 5:03 AM, Hans Verkuil wrote: >> >> which is clearly a sparse bug somewhere. > > Yes. What is going on is that we create separate symbols for each > declaration, and we tie them all together (and warn if they have > conflicting types). > > But then when we look up a symbol, we only look at the latest one, so > when we size the array, we look at that "extern" declaration, and > don't see the size that was created with the initializer. > > I'll think about how to fix it cleanly. Expect a patch shortly. Great! Tomorrow I'll try to write test cases for the two other sparse problems I found. Regards, Hans