From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-sender-0.a4lg.com (mail-sender.a4lg.com [153.120.152.154]) by sourceware.org (Postfix) with ESMTPS id 88CAF3858C2D for ; Tue, 11 Oct 2022 14:29:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 88CAF3858C2D Received: from [127.0.0.1] (localhost [127.0.0.1]) by mail-sender-0.a4lg.com (Postfix) with ESMTPSA id A1703300089; Tue, 11 Oct 2022 14:29:54 +0000 (UTC) Message-ID: <692e7f2e-2e44-d01c-3f29-cfcbb56efac5@irq.a4lg.com> Date: Tue, 11 Oct 2022 23:29:52 +0900 Mime-Version: 1.0 Subject: Re: [PATCH v3 1/5] sim: Remove self-assignments Content-Language: en-US To: Andrew Burgess Cc: gdb-patches@sourceware.org References: <05fdda8763f4377f1745bc9aa322b79e08f3d677.1665038297.git.research_trasio@irq.a4lg.com> <87h70acuff.fsf@redhat.com> From: Tsukasa OI In-Reply-To: <87h70acuff.fsf@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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: , X-List-Received-Date: Tue, 11 Oct 2022 14:30:12 -0000 On 2022/10/11 23:21, Andrew Burgess wrote: > 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 My another (upcoming) patchset included exact changes to sim/ppc/tree.c but thanks for adding it anyway. Thanks, Tsukasa > > --- > > 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) { >