From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id Rj84FRJ8RWOl3QkAWB0awg (envelope-from ) for ; Tue, 11 Oct 2022 10:22:10 -0400 Received: by simark.ca (Postfix, from userid 112) id 4F67F1E112; Tue, 11 Oct 2022 10:22:10 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=TIPaZ7pI; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 04CB71E0D5 for ; Tue, 11 Oct 2022 10:22:10 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A9E163857357 for ; Tue, 11 Oct 2022 14:22:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A9E163857357 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1665498129; bh=ZKBKtWClLSGHxYEETN6KwzlNIRbVq/HAqwEcfKeJTlg=; h=To:Subject:In-Reply-To:References:Date:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=TIPaZ7pIHFm+CQZr0GdAY7nI9cXJ4zJqCwbcMRgjcTeWc/rYiw4acB3NRULl4RaD7 Oqj8pAeTWSdugYZj9q6OYK+daYoALyBp5z4Xd6uWnPajNrf0k1lEe9D+M6+7kUo3cV 1sPCWX/H1o2+8QZnCKZddxmqAEmZJOfEdfo2seaQ= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 4B8783858C2D for ; Tue, 11 Oct 2022 14:21:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4B8783858C2D Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-507-MmORKzzvOxCAYNNdTBL2HQ-1; Tue, 11 Oct 2022 10:21:42 -0400 X-MC-Unique: MmORKzzvOxCAYNNdTBL2HQ-1 Received: by mail-wm1-f69.google.com with SMTP id ay21-20020a05600c1e1500b003b45fd14b53so768109wmb.1 for ; Tue, 11 Oct 2022 07:21:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ZKBKtWClLSGHxYEETN6KwzlNIRbVq/HAqwEcfKeJTlg=; b=dh3Uq7mgBkjf2xHxZD3G54ouPGrFQlT/eNziKTBbLFuJaIeYe4EMezkb3xeyuEl8rx PXcYxGExx7pSZwzasPJbx7917VLCvAANJU+5Dxrt6PL8crS91hD6to1huoLHWVsMCIRP SL1r7jZ7U02DRltkrAn53ZyJ2veYSIA7JHRwGd+gUmoHA+mH3akfbggc4XETxmgdlb8P 70zqfDHmehV6ApVnuaKov0FYa9hcSwyolQgHVPocIxhFhBIOh00kAUk+vtTe3tus5s7M DdrhAOCn6h6KEBqEShTojAhyJ/8qXcO1soiAdUs6ydXWnNv+QH2hVc73RVPQARTybmnb oxoQ== X-Gm-Message-State: ACrzQf0HTVoRNdUxD/Qmn6YYePUQEQX29Jc0oh3kUOuJPGHbgv+qzEKD neWiGFjt0N+BIXfr2/b8CGzB+C+cwwmWLG2vLNEk5sYD+xnFqaV1Xy65xT7ODP9ZauuyhHwriun Xj3udfJLSEu6Ob6N/qN5iBA== X-Received: by 2002:adf:d1ca:0:b0:231:aedc:7ece with SMTP id b10-20020adfd1ca000000b00231aedc7ecemr1309170wrd.72.1665498101526; Tue, 11 Oct 2022 07:21:41 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5M4yUKZVc8RqLBV/TJBlAlaF8SD0mfmxzV6DuY+LxmdDx5d//l+AKBR1DVT+u0jIHEzqS3Tg== X-Received: by 2002:adf:d1ca:0:b0:231:aedc:7ece with SMTP id b10-20020adfd1ca000000b00231aedc7ecemr1309158wrd.72.1665498101321; Tue, 11 Oct 2022 07:21:41 -0700 (PDT) Received: from localhost (52.72.115.87.dyn.plus.net. [87.115.72.52]) by smtp.gmail.com with ESMTPSA id l17-20020a05600c1d1100b003a4efb794d7sm13717609wms.36.2022.10.11.07.21.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Oct 2022 07:21:40 -0700 (PDT) To: Tsukasa OI , Tsukasa OI , Mike Frysinger Subject: Re: [PATCH v3 1/5] sim: Remove self-assignments In-Reply-To: <05fdda8763f4377f1745bc9aa322b79e08f3d677.1665038297.git.research_trasio@irq.a4lg.com> References: <05fdda8763f4377f1745bc9aa322b79e08f3d677.1665038297.git.research_trasio@irq.a4lg.com> Date: Tue, 11 Oct 2022 15:21:40 +0100 Message-ID: <87h70acuff.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Andrew Burgess via Gdb-patches Reply-To: Andrew Burgess Cc: gdb-patches@sourceware.org Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" Tsukasa OI writes: > Clang generates a warning if there is a redundant self-assignment > ("-Wself-assign"). On the default configuration, it causes a build failure > (unless "--disable-werror" is specified). > > This commit removes two redundant self-assignments. I pushed this patch, but I found a couple more of these in ppc/tree.c which I included in this commit. Thanks, Andrew --- commit 5294d882ebb5b10f8a246f2c51ffef05622ef16c Author: Tsukasa OI Date: Sun Sep 25 08:42:02 2022 +0000 sim: Remove self-assignments Clang generates a warning if there is a redundant self-assignment ("-Wself-assign"). On the default configuration, it causes a build failure (unless "--disable-werror" is specified). This commit removes redundant self-assignments from two files. diff --git a/sim/common/hw-tree.c b/sim/common/hw-tree.c index 56319333d76..8bb5ac77545 100644 --- a/sim/common/hw-tree.c +++ b/sim/common/hw-tree.c @@ -335,7 +335,6 @@ split_find_device (struct hw *current, else if (strncmp (spec->path, "./", strlen ("./")) == 0) { /* cd ./... */ - current = current; spec->path += strlen ("./"); } else if (strncmp (spec->path, "../", strlen ("../")) == 0) @@ -348,7 +347,6 @@ split_find_device (struct hw *current, else if (strcmp (spec->path, ".") == 0) { /* cd . */ - current = current; spec->path += strlen ("."); } else if (strcmp (spec->path, "..") == 0) diff --git a/sim/ppc/tree.c b/sim/ppc/tree.c index 6d20665505e..05532bb47ee 100644 --- a/sim/ppc/tree.c +++ b/sim/ppc/tree.c @@ -306,7 +306,6 @@ split_find_device(device *current, } else if (strncmp(spec->path, "./", strlen("./")) == 0) { /* cd ./... */ - current = current; spec->path += strlen("./"); } else if (strncmp(spec->path, "../", strlen("../")) == 0) { @@ -317,7 +316,6 @@ split_find_device(device *current, } else if (strcmp(spec->path, ".") == 0) { /* cd . */ - current = current; spec->path += strlen("."); } else if (strcmp(spec->path, "..") == 0) {