From 5294d882ebb5b10f8a246f2c51ffef05622ef16c Mon Sep 17 00:00:00 2001 From: Tsukasa OI Date: Sun, 25 Sep 2022 08:42:02 +0000 Subject: [PATCH] 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. --- sim/common/hw-tree.c | 2 -- sim/ppc/tree.c | 2 -- 2 files changed, 4 deletions(-) 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) { -- 2.30.2