From patchwork Fri Dec 12 04:32:47 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christopher Li X-Patchwork-Id: 5478921 Return-Path: X-Original-To: patchwork-linux-sparse@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 7F0F0BEEA8 for ; Fri, 12 Dec 2014 04:32:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7EA5D201D3 for ; Fri, 12 Dec 2014 04:32:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 65E16201B9 for ; Fri, 12 Dec 2014 04:32:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965324AbaLLEcs (ORCPT ); Thu, 11 Dec 2014 23:32:48 -0500 Received: from mail-qc0-f172.google.com ([209.85.216.172]:50116 "EHLO mail-qc0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965322AbaLLEcs (ORCPT ); Thu, 11 Dec 2014 23:32:48 -0500 Received: by mail-qc0-f172.google.com with SMTP id m20so5110400qcx.3 for ; Thu, 11 Dec 2014 20:32:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=HfvTpXnetz+fX6tI6M5CUeUzePpKynvzGRvLmIKi/Gw=; b=MBz8lz9rpZBsEipTyRoommswakQ2/PwjdMbzr8f9QXGS6vvereIN1YaMtm9ams4uG7 ZV1dK6eff01Rns3oEwDXWUOJEaWCvozhyMtIBJvwBv4lWj+S8ZXXy/K4aamvhcl9d3+L eQAVopkvT2JMjdfW7SAoDl/DPplkkSQEqQTxd5I8KO4WUp5E9YJvk3OC92nC/Tk408gz +Jgnx4fPE+YblRcm/o2iCIBbBCh8Pwiaa3AXmLX8JoXTZsQ77wVT23V3UiR1m4lwXvjs LWaKmNu4cDQdCl0/KlNyPkhzKDgm97MZtD9CZOSpMjKyJmmhTItteNWUCX5G5oHjH5uN JEng== MIME-Version: 1.0 X-Received: by 10.224.164.195 with SMTP id f3mr27570949qay.55.1418358767670; Thu, 11 Dec 2014 20:32:47 -0800 (PST) Received: by 10.140.21.199 with HTTP; Thu, 11 Dec 2014 20:32:47 -0800 (PST) In-Reply-To: <5481B580.3080100@xs4all.nl> References: <5400357A.5050705@xs4all.nl> <5481B580.3080100@xs4all.nl> Date: Fri, 12 Dec 2014 12:32:47 +0800 X-Google-Sender-Auth: PZ7MYaZbuMzBGZ7VcsngBLnJqsg Message-ID: Subject: Re: Bogus 'Initializer entry defined twice' warnings From: Christopher Li To: Hans Verkuil Cc: Linux-Sparse , Linus Torvalds Sender: linux-sparse-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sparse@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Fri, Dec 5, 2014 at 9:39 PM, Hans Verkuil 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. Reported-by: Hans Verkuil Signed-off-by: Christopher Li Chris --- To unsubscribe from this list: send the line "unsubscribe linux-sparse" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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)