Re: sparse: ARRAY_SIZE and sparse array initialization

2014-03-30 Thread Christopher Li
On Fri, Mar 28, 2014 at 3:50 AM, Hans Verkuil hverk...@xs4all.nl wrote: Is there any chance that the three issues I reported will be fixed? If not, then I'll work around it in the kernel code. Most likely it is a sparse issue. Can you generate a minimal stand alone test case that expose this

Re: sparse: ARRAY_SIZE and sparse array initialization

2014-03-30 Thread Hans Verkuil
Hi Chris, On 03/30/2014 08:10 AM, Christopher Li wrote: On Fri, Mar 28, 2014 at 3:50 AM, Hans Verkuil hverk...@xs4all.nl wrote: Is there any chance that the three issues I reported will be fixed? If not, then I'll work around it in the kernel code. Most likely it is a sparse issue. Can you

Re: sparse: ARRAY_SIZE and sparse array initialization

2014-03-30 Thread Linus Torvalds
On Sun, Mar 30, 2014 at 5:03 AM, Hans Verkuil hverk...@xs4all.nl 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

Re: sparse: ARRAY_SIZE and sparse array initialization

2014-03-30 Thread Hans Verkuil
On 03/30/2014 06:48 PM, Linus Torvalds wrote: On Sun, Mar 30, 2014 at 5:03 AM, Hans Verkuil hverk...@xs4all.nl 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

Re: sparse: ARRAY_SIZE and sparse array initialization

2014-03-30 Thread Christopher Li
On Sun, Mar 30, 2014 at 9:48 AM, Linus Torvalds torva...@linux-foundation.org wrote: 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. Exactly. Sparse

Re: sparse: ARRAY_SIZE and sparse array initialization

2014-03-30 Thread Linus Torvalds
On Sun, Mar 30, 2014 at 9:48 AM, Linus Torvalds torva...@linux-foundation.org wrote: I'll think about how to fix it cleanly. Expect a patch shortly. Ok, patch sent to linux-sparse mailing list. It fixes the particular cut-down test-case and seems pretty simple and straightforward, but is

Re: sparse: ARRAY_SIZE and sparse array initialization

2014-03-28 Thread Hans Verkuil
Is there any chance that the three issues I reported will be fixed? If not, then I'll work around it in the kernel code. Regards, Hans On 03/15/2014 01:12 PM, Hans Verkuil wrote: For the record: all these tests were done with a 3.14-rc5 kernel and sparse compiled from the git tree as

sparse: ARRAY_SIZE and sparse array initialization

2014-03-15 Thread Hans Verkuil
Hmm, interesting. Twice 'sparse' in the same subject line with different meanings :-) This is another sparse error I get with drivers/media/v4l2-core/v4l2-ioctl.c: drivers/media/v4l2-core/v4l2-ioctl.c:424:9: error: cannot size expression (there are more of those in drivers/media, all with the

Re: sparse: ARRAY_SIZE and sparse array initialization

2014-03-15 Thread Hans Verkuil
For the record: all these tests were done with a 3.14-rc5 kernel and sparse compiled from the git tree as of today (version v0.5.0). The gcc version is 4.8.2. Regards, Hans On 03/15/2014 01:09 PM, Hans Verkuil wrote: Hmm, interesting. Twice 'sparse' in the same subject line with