From: Christopher Li <sparse@chrisli.org>
To: Hans Verkuil <hverkuil@xs4all.nl>
Cc: Linux-Sparse <linux-sparse@vger.kernel.org>,
Linux Media Mailing List <linux-media@vger.kernel.org>
Subject: Re: sparse: ARRAY_SIZE and sparse array initialization
Date: Sat, 29 Mar 2014 23:10:43 -0700 [thread overview]
Message-ID: <CANeU7Qksj-tq0fjsZya1otX75sV4JOsAdXHr5Kxu-WyvYrksSw@mail.gmail.com> (raw)
In-Reply-To: <533553E6.3060508@xs4all.nl>
On Fri, Mar 28, 2014 at 3:50 AM, Hans Verkuil <hverkuil@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 bug? I try to simplify it as following, but
it does not
reproduce the error.
#define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]))
static const char *v4l2_type_names[] = {
[1] = "mmap",
[9] = "userptr",
[2] = "overlay",
[3] = "dmabuf",
};
#define prt_names(a, arr) (((unsigned)(a)) < ARRAY_SIZE(arr) ? arr[a]
: "unknown")
extern void prt(const char *name);
static void v4l_print_requestbuffers(const void *arg, int write_only)
{
const struct v4l2_requestbuffers *p = arg;
prt(prt_names(3, v4l2_type_names));
}
If you have the test case, you are welcome to submit a patch to
add the test case.
Chris
next prev parent reply other threads:[~2014-03-30 6:10 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-15 12:09 sparse: ARRAY_SIZE and sparse array initialization Hans Verkuil
2014-03-15 12:12 ` Hans Verkuil
2014-03-28 10:50 ` Hans Verkuil
2014-03-30 6:10 ` Christopher Li [this message]
2014-03-30 12:03 ` Hans Verkuil
2014-03-30 16:48 ` Linus Torvalds
2014-03-30 17:03 ` Hans Verkuil
2014-03-30 17:16 ` Christopher Li
2014-03-30 17:24 ` Linus Torvalds
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=CANeU7Qksj-tq0fjsZya1otX75sV4JOsAdXHr5Kxu-WyvYrksSw@mail.gmail.com \
--to=sparse@chrisli.org \
--cc=hverkuil@xs4all.nl \
--cc=linux-media@vger.kernel.org \
--cc=linux-sparse@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).