diff mbox

[v2] dtc: Remove unused variable in flat_read_mem_reserve

Message ID 20110628134711.GF10237@zod.rchland.ibm.com (mailing list archive)
State Not Applicable
Delegated to: Josh Boyer
Headers show

Commit Message

Josh Boyer June 28, 2011, 1:47 p.m. UTC
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>

---

Comments

David Gibson July 15, 2011, 1:57 p.m. UTC | #1
On Tue, Jun 28, 2011 at 09:47:11AM -0400, Josh Boyer wrote:
> 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>

Jon, please apply.
Jon Loeliger July 17, 2011, 12:36 p.m. UTC | #2
> On Tue, Jun 28, 2011 at 09:47:11AM -0400, Josh Boyer wrote:
> > 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>

Applied.

jdl
diff mbox

Patch

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);