[Crosstoolchain-logs] [device-tree-compiler] 06/198: dtc: Remove gcc 4.6 "set but not used" warnings

Hector Oron zumbi at moszumanska.debian.org
Thu Dec 8 17:06:48 UTC 2016


This is an automated email from the git hooks/post-receive script.

zumbi pushed a commit to branch upstream/1.4.x
in repository device-tree-compiler.

commit 83df28bd39979b32a75656cac291c36dbd4e5497
Author: David Gibson <david at gibson.dropbear.id.au>
Date:   Mon Sep 12 11:18:43 2011 +1000

    dtc: Remove gcc 4.6 "set but not used" warnings
    
    A number of the dtc testcases trigger the new "variable set but not
    used" warning from gcc 4.6.  That is they have variables which are
    assigned, but then never read after that point.
    
    In a couple of cases this is just because the variables aren't needed,
    so this patch removes them.  In subnode_offset.c, it's because one
    pair of variables we clearly intended to test we don't actually test.
    This patch also adds this missing check.
    
    This patch makes the testsuite compile clean with gcc 4.6.
    
    Signed-off-by: David Gibson <david at gibson.dropbear.id.au>
---
 tests/notfound.c       | 8 +++-----
 tests/path_offset.c    | 4 ++++
 tests/subnode_offset.c | 6 +++---
 3 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/tests/notfound.c b/tests/notfound.c
index 38918ad..4d55b88 100644
--- a/tests/notfound.c
+++ b/tests/notfound.c
@@ -37,27 +37,25 @@ static void check_error(const char *s, int err)
 
 int main(int argc, char *argv[])
 {
-	const struct fdt_property *prop;
 	void *fdt;
 	int offset;
 	int subnode1_offset;
-	const void *val;
 	int lenerr;
 
 	test_init(argc, argv);
 	fdt = load_blob_arg(argc, argv);
 
-	prop = fdt_get_property(fdt, 0, "nonexistant-property", &lenerr);
+	fdt_get_property(fdt, 0, "nonexistant-property", &lenerr);
 	check_error("fdt_get_property(\"nonexistant-property\")", lenerr);
 
-	val = fdt_getprop(fdt, 0, "nonexistant-property", &lenerr);
+	fdt_getprop(fdt, 0, "nonexistant-property", &lenerr);
 	check_error("fdt_getprop(\"nonexistant-property\"", lenerr);
 
 	subnode1_offset = fdt_subnode_offset(fdt, 0, "subnode at 1");
 	if (subnode1_offset < 0)
 		FAIL("Couldn't find subnode1: %s", fdt_strerror(subnode1_offset));
 
-	val = fdt_getprop(fdt, subnode1_offset, "prop-str", &lenerr);
+	fdt_getprop(fdt, subnode1_offset, "prop-str", &lenerr);
 	check_error("fdt_getprop(\"prop-str\")", lenerr);
 
 	offset = fdt_subnode_offset(fdt, 0, "nonexistant-subnode");
diff --git a/tests/path_offset.c b/tests/path_offset.c
index bb092f1..d3e1f8e 100644
--- a/tests/path_offset.c
+++ b/tests/path_offset.c
@@ -104,5 +104,9 @@ int main(int argc, char *argv[])
 		FAIL("Mismatch between subnode_offset (%d) and path_offset (%d)",
 		     subsubnode2_offset, subsubnode2_offset_p);
 
+	if (subsubnode2_offset2 != subsubnode2_offset2_p)
+		FAIL("Mismatch between subnode_offset (%d) and path_offset (%d)",
+		     subsubnode2_offset2, subsubnode2_offset2_p);
+
 	PASS();
 }
diff --git a/tests/subnode_offset.c b/tests/subnode_offset.c
index b961070..e58c192 100644
--- a/tests/subnode_offset.c
+++ b/tests/subnode_offset.c
@@ -60,7 +60,7 @@ int main(int argc, char *argv[])
 	void *fdt;
 	int subnode1_offset, subnode2_offset;
 	int subsubnode1_offset, subsubnode2_offset, subsubnode2_offset2;
-	int ss11_off, ss12_off, ss21_off, ss22_off;
+	int ss12_off, ss21_off;
 
 	test_init(argc, argv);
 	fdt = load_blob_arg(argc, argv);
@@ -85,7 +85,7 @@ int main(int argc, char *argv[])
 	if (subsubnode2_offset != subsubnode2_offset2)
 		FAIL("Different offsets with and without unit address");
 
-	ss11_off = check_subnode(fdt, subnode1_offset, "ss1");
+	check_subnode(fdt, subnode1_offset, "ss1");
 	ss21_off = fdt_subnode_offset(fdt, subnode2_offset, "ss1");
 	if (ss21_off != -FDT_ERR_NOTFOUND)
 		FAIL("Incorrectly found ss1 in subnode2");
@@ -93,7 +93,7 @@ int main(int argc, char *argv[])
 	ss12_off = fdt_subnode_offset(fdt, subnode1_offset, "ss2");
 	if (ss12_off != -FDT_ERR_NOTFOUND)
 		FAIL("Incorrectly found ss2 in subnode1");
-	ss22_off = check_subnode(fdt, subnode2_offset, "ss2");
+	check_subnode(fdt, subnode2_offset, "ss2");
 
 	PASS();
 }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/crosstoolchain/device-tree-compiler.git



More information about the Crosstoolchain-logs mailing list