public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Ben Widawsky <ben@bwidawsk.net>
To: Paulo Zanoni <przanoni@gmail.com>
Cc: intel-gfx@lists.freedesktop.org,
	Ben Widawsky <benjamin.widawsky@intel.com>
Subject: Re: [PATCH 2/9] drm/i915: [sparse] don't use variable size arrays
Date: Tue, 17 Apr 2012 19:20:35 -0700	[thread overview]
Message-ID: <20120417192035.5b3e58a4@bwidawsk.net> (raw)
In-Reply-To: <CA+gsUGS+yy6DbqhrtDt==XWzQdB6z0vkiE-b8qPqmSx7C6ObNw@mail.gmail.com>

On Tue, 17 Apr 2012 22:39:15 -0300
Paulo Zanoni <przanoni@gmail.com> wrote:

> 2012/4/16 Ben Widawsky <ben@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.

  reply	other threads:[~2012-04-18  2:20 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-16 21:07 [PATCH 0/9] i915 fixes for sparse warnings Ben Widawsky
2012-04-16 21:07 ` [PATCH 1/9] drm/i915: [sparse] trivial sparse fixes Ben Widawsky
2012-04-16 21:13   ` Chris Wilson
2012-04-16 21:07 ` [PATCH 2/9] drm/i915: [sparse] don't use variable size arrays Ben Widawsky
2012-04-18  1:39   ` Paulo Zanoni
2012-04-18  2:20     ` Ben Widawsky [this message]
2012-04-18  9:05       ` Daniel Vetter
2012-04-16 21:07 ` [PATCH 3/9] drm/i915: [sparse] __iomem fixes for opregion Ben Widawsky
2012-04-16 21:07 ` [PATCH 4/9] drm/i915: [sparse] __iomem fixes for overlay Ben Widawsky
2012-04-16 21:07 ` [PATCH 5/9] drm/i915: [sparse] __iomem fixes for debugfs Ben Widawsky
2012-04-16 21:07 ` [PATCH 6/9] drm/i915: [sparse] __iomem fixes for ringbuffer Ben Widawsky
2012-04-16 21:28   ` Chris Wilson
2012-04-16 21:07 ` [PATCH 7/9] drm/i915: [sparse] forced __iomem ringbuffer fixes Ben Widawsky
2012-04-16 21:07 ` [PATCH 8/9] drm/i915: [sparse] __iomem fixes for gem Ben Widawsky
2012-04-16 21:07 ` [PATCH 9/9] drm/i915: [sparse] __iomem fixes for intel_bios Ben Widawsky
2012-04-21 20:59 ` [PATCH 0/9] i915 fixes for sparse warnings Daniel Vetter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120417192035.5b3e58a4@bwidawsk.net \
    --to=ben@bwidawsk.net \
    --cc=benjamin.widawsky@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=przanoni@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox