From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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) From: Andrew Burgess To: Tsukasa OI , Tsukasa OI , Mike Frysinger Cc: gdb-patches@sourceware.org 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-Spam-Status: No, score=-10.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NONE, 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:21:50 -0000 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) {