All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans Verkuil <hverkuil@xs4all.nl>
To: Christopher Li <sparse@chrisli.org>
Cc: Linux-Sparse <linux-sparse@vger.kernel.org>,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: Bogus 'Initializer entry defined twice' warnings
Date: Fri, 12 Dec 2014 09:04:14 +0100	[thread overview]
Message-ID: <548AA17E.9030504@xs4all.nl> (raw)
In-Reply-To: <CANeU7Qko4VY_hZbuuNVLbRjaiEeFAyb8VLDmew0zSz1SYrPA9w@mail.gmail.com>

On 12/12/2014 05:32 AM, Christopher Li wrote:
> On Fri, Dec 5, 2014 at 9:39 PM, Hans Verkuil <hverkuil@xs4all.nl> wrote:
>>> Still need more work to fix it.
>>
>> Any updates on this?
>>
> 
> The search is over.
> 
>     Ptr list sorting should use memmove instead of memcpy
> 
>     The target buffer is overlapped with source buffer.
>     This cause the duplicate entry warning reported by Hans.

Fantastic! This fixes the problem, now I can concentrate on getting rid
of the last few remaining sparse warnings in drivers/media.

Regards,

	Hans

> 
>     Reported-by: Hans Verkuil <hverkuil@xs4all.nl>
>     Signed-off-by: Christopher Li <sparse@chrisli.org>
> 
> diff --git a/sort.c b/sort.c
> index afd7184..430ba44 100644
> --- a/sort.c
> +++ b/sort.c
> @@ -99,7 +99,7 @@ static void verify_seq_sorted (struct ptr_list *l, int n,
>         assert (nbuf >= nr);                                    \
>         memcpy ((b)->list, buffer, nr * sizeof (void *));       \
>         nbuf -= nr;                                             \
> -       memcpy (buffer, buffer + nr, nbuf * sizeof (void *));   \
> +       memmove (buffer, buffer + nr, nbuf * sizeof (void *));  \
>    } while (0)
> 
> 
> Chris
> 


  reply	other threads:[~2014-12-12  8:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-29  8:10 Bogus 'Initializer entry defined twice' warnings Hans Verkuil
2014-11-05  7:44 ` Hans Verkuil
2014-11-05 10:49   ` Christopher Li
2014-11-12 15:39 ` Christopher Li
2014-12-05 13:39   ` Hans Verkuil
2014-12-09  1:11     ` Christopher Li
2014-12-12  4:32     ` Christopher Li
2014-12-12  8:04       ` Hans Verkuil [this message]
2014-12-12  8:12       ` Josh Triplett

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=548AA17E.9030504@xs4all.nl \
    --to=hverkuil@xs4all.nl \
    --cc=linux-sparse@vger.kernel.org \
    --cc=sparse@chrisli.org \
    --cc=torvalds@linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.