[Intel-gfx] [PATCH 2/9] drm/i915: [sparse] don't use variable size arrays

Daniel Vetter daniel at ffwll.ch
Wed Apr 18 11:05:29 CEST 2012


On Tue, Apr 17, 2012 at 07:20:35PM -0700, Ben Widawsky wrote:
> On Tue, 17 Apr 2012 22:39:15 -0300
> Paulo Zanoni <przanoni at gmail.com> wrote:
> 
> > 2012/4/16 Ben Widawsky <ben at bwidawsk.net>:
> > > Sparse doesn't like:
> > > "error: bad constant expression"
> > >
> > 
> > <bikeshedding>
> > I know you'll hate me for asking, but: how difficult is it to fix sparse?
> > Adding those mallocs/frees increases the code complexity, making it
> > harder to read...
> > </bikeshedding>
> > 
> 
> I don't consider this a bikeshed. I've always been "under the
> impression" C99 was sort of taboo in the kernel. In this case
> specifically, it's never a great idea to allocate an unknown amount of
> stack space as it probably messes with some of the static tools and
> such.
> 
> In other words, I believe the right thing to do here is not to fix
> sparse. Plus there is precedent in other drivers to fix this kind of
> thing for sparse. I originally had this patch create an arbitrarily
> large object on the stack and fail if the args_len was too big. I can
> go back to that certainly if people prefer.

I've picked up the first 2 patches of this series for -next, with a tiny
bikeshed on the 2nd one. I've gotten stuck while reviewing the next one,
I think it'd be good if we can quickly discuss these on irc.
-Daniel
-- 
Daniel Vetter
Mail: daniel at ffwll.ch
Mobile: +41 (0)79 365 57 48



More information about the Intel-gfx mailing list