From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 2N7qOgd+RWOt3gkAWB0awg (envelope-from ) for ; Tue, 11 Oct 2022 10:30:31 -0400 Received: by simark.ca (Postfix, from userid 112) id EDF111E112; Tue, 11 Oct 2022 10:30:31 -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=G1+e2dw4; 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 988B71E0D5 for ; Tue, 11 Oct 2022 10:30:31 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 491C8385842E for ; Tue, 11 Oct 2022 14:30:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 491C8385842E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1665498631; bh=ZKKWuYdNbykaUzX1316iDuznoOowUFag5Zme4ZqatHQ=; h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=G1+e2dw4ThZa5hRkMnrMe8cwgzmfgAkxYGwjMAIYjHA0D5fQ5zKgs7q3L9bClDXlS rNo6HT8FJ5Ct86a1Li+6/ZLfCZZrmcqHCad60tNqM7iFYGZ38PB9Hwktxwdkatnf/v QsIoW+S+osNa6UaalaqBAbG2t74ynoJwKLofxcjI= 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 References: <05fdda8763f4377f1745bc9aa322b79e08f3d677.1665038297.git.research_trasio@irq.a4lg.com> <87h70acuff.fsf@redhat.com> In-Reply-To: <87h70acuff.fsf@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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: Tsukasa OI via Gdb-patches Reply-To: Tsukasa OI Cc: gdb-patches@sourceware.org Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" 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) { >