Re: Bogus 'Initializer entry defined twice' warnings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12/12/2014 05:32 AM, Christopher Li wrote:
> On Fri, Dec 5, 2014 at 9:39 PM, Hans Verkuil <hverkuil@xxxxxxxxx> 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@xxxxxxxxx>
>     Signed-off-by: Christopher Li <sparse@xxxxxxxxxxx>
> 
> 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
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux