From: Hans Verkuil <hverkuil@xs4all.nl>
To: Hans de Goede <hdegoede@redhat.com>,
Ismael Luceno <ismael.luceno@gmail.com>,
linux-media@vger.kernel.org
Subject: Re: [PATCH] gspca_gl860: Clean up idxdata structs
Date: Mon, 17 Mar 2014 14:21:23 +0100 [thread overview]
Message-ID: <5326F6D3.8010307@xs4all.nl> (raw)
In-Reply-To: <53242699.3080308@redhat.com>
On 03/15/2014 11:08 AM, Hans de Goede wrote:
> Hi,
>
> Some better commit msg would be nice, otherwise this patch is:
>
> Acked-by: Hans de Goede <hdegoede@redhat.com>
>
> Hans Verkuil has mailed me that he would like to pick this up through
> his tree. Hans V. , I say go for it :)
I noticed that these sparse warnings suddenly disappeared after switching to
sparse-0.5.0. It turns out to be a sparse bug:
commit 0edb7edecdd571c2663eb12acac1b27b9acac657
Author: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Date: Thu May 16 20:41:24 2013 +0100
char.c: Fix parsing of escapes
When parsing a string or character constant, the parse_escape()
function returns a pointer to the character at which to resume
parsing. However, in the case of an hex or octal escape, it was
returning a one-past-the-end pointer. Thus, a string like:
char str[3] = "\x61\x62\x63";
was being parsed as:
'\x61', 'x', '6', '2', '\x63'
which, in turn, provokes an 'too long initializer' warning.
Also, fix an off-by-one error in get_char_constant() when setting
the 'end' pointer for a TOKEN_CHAR or TOKEN_WIDE_CHAR. Despite the
name, the string->length of the token is actually the size of the
allocated memory (ie len+1), so we need to compensate by using
'token->string->length - 1'.
That said, I think it is really ugly to use a string like that and I still
would like to apply this patch, although for 3.16, not 3.15 as was my
original intention.
Hans, do you agree with that approach? Or do you prefer to keep it as is?
Regards,
Hans
>
> Regards,
>
> Hans
>
>
> On 03/14/2014 08:43 PM, Ismael Luceno wrote:
>> Signed-off-by: Ismael Luceno <ismael.luceno@gmail.com>
>> ---
>> drivers/media/usb/gspca/gl860/gl860-mi2020.c | 464 ++++++++++++++++-----------
>> 1 file changed, 268 insertions(+), 196 deletions(-)
>>
>> diff --git a/drivers/media/usb/gspca/gl860/gl860-mi2020.c b/drivers/media/usb/gspca/gl860/gl860-mi2020.c
>> index 2edda6b..a785828 100644
>> --- a/drivers/media/usb/gspca/gl860/gl860-mi2020.c
>> +++ b/drivers/media/usb/gspca/gl860/gl860-mi2020.c
>> @@ -35,32 +35,34 @@ static u8 dat_hvflip5[] = {0x8c, 0xa1, 0x03};
>> static u8 dat_hvflip6[] = {0x90, 0x00, 0x06};
>>
>> static struct idxdata tbl_middle_hvflip_low[] = {
>> - {0x33, "\x90\x00\x06"},
>> - {6, "\xff\xff\xff"},
>> - {0x33, "\x90\x00\x06"},
>> - {6, "\xff\xff\xff"},
>> - {0x33, "\x90\x00\x06"},
>> - {6, "\xff\xff\xff"},
>> - {0x33, "\x90\x00\x06"},
>> - {6, "\xff\xff\xff"},
>> + {0x33, {0x90, 0x00, 0x06}},
>> + {6, {0xff, 0xff, 0xff}},
>> + {0x33, {0x90, 0x00, 0x06}},
>> + {6, {0xff, 0xff, 0xff}},
>> + {0x33, {0x90, 0x00, 0x06}},
>> + {6, {0xff, 0xff, 0xff}},
>> + {0x33, {0x90, 0x00, 0x06}},
>> + {6, {0xff, 0xff, 0xff}},
>> };
<snip>
next prev parent reply other threads:[~2014-03-17 13:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-14 19:43 [PATCH] gspca_gl860: Clean up idxdata structs Ismael Luceno
2014-03-15 10:08 ` Hans de Goede
2014-03-17 13:21 ` Hans Verkuil [this message]
2014-03-17 19:20 ` Hans de Goede
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=5326F6D3.8010307@xs4all.nl \
--to=hverkuil@xs4all.nl \
--cc=hdegoede@redhat.com \
--cc=ismael.luceno@gmail.com \
--cc=linux-media@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