File: 03_Remove-unused-variable-in-flat_read_mem_reserve.patch

package info (click to toggle)
device-tree-compiler 1.4.2-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,580 kB
  • sloc: ansic: 9,213; sh: 793; asm: 655; lex: 510; yacc: 408; makefile: 252; perl: 74
file content (42 lines) | stat: -rw-r--r-- 1,439 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
From: Josh Boyer <jwboyer@linux.vnet.ibm.com>
Date: Tue, 28 Jun 2011 13:47:11 +0000 (-0400)
Subject: dtc: Remove unused variable in flat_read_mem_reserve
X-Git-Url: http://git.jdl.com/gitweb/?p=dtc.git;a=commitdiff_plain;h=d5b3165023b1cc3914e9943b91964ec9ad4be8b2

dtc: Remove unused variable in flat_read_mem_reserve

The *p variable is declared and used to save inb->ptr, however p is
later never used.  This has been the case since commit 6c0f3676 and can
lead to build failures with -Werror=unused-but-set-variable:

	flattree.c: In function 'flat_read_mem_reserve':
	flattree.c:700:14: error: variable 'p' set but not used [-Werror=unused-but-set-variable]
	cc1: all warnings being treated as errors
	make: *** [flattree.o] Error 1

Remove the variable.

Signed-off-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
---

diff --git a/flattree.c b/flattree.c
index ead0332..28d0b23 100644
--- a/flattree.c
+++ b/flattree.c
@@ -697,7 +697,6 @@ static struct reserve_info *flat_read_mem_reserve(struct inbuf *inb)
 {
 	struct reserve_info *reservelist = NULL;
 	struct reserve_info *new;
-	const char *p;
 	struct fdt_reserve_entry re;
 
 	/*
@@ -706,7 +705,6 @@ static struct reserve_info *flat_read_mem_reserve(struct inbuf *inb)
 	 *
 	 * First pass, count entries.
 	 */
-	p = inb->ptr;
 	while (1) {
 		flat_read_chunk(inb, &re, sizeof(re));
 		re.address  = fdt64_to_cpu(re.address);