From: Tsukasa OI Date: Sun, 25 Sep 2022 08:42:02 +0000 (+0000) Subject: sim: Remove self-assignments X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5294d882ebb5b10f8a246f2c51ffef05622ef16c;p=binutils-gdb.git 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) {