Skip to contentSkip to conversation

m68k: fix unused variable warning in mempcy.c

PATCH New [email protected] 1 participant 1 message Oct 29, 2012 m68k architecture

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 m68k: fix unused variable warning in mempcy.c

From: Greg Ungerer <[email protected]>

When compiling for original 68000 or ColdFire targets you will get the following warning when compiling arch/m68k/lib/memcpy.c:

CC arch/m68k/lib/memcpy.o
arch/m68k/lib/memcpy.c: In function ‘__builtin_memcpy’:
arch/m68k/lib/memcpy.c:13:15: warning: unused variable ‘temp1’

This is easily fixed by moving the definition of temp1 into the code block where it is used.

---
 arch/m68k/lib/memcpy.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
arch/m68k/lib/memcpy.c +2 -1
index 10ca051..c1e2dfb 100644
@@ -10,7 +10,7 @@
 void *memcpy(void *to, const void *from, size_t n)
 {
 	void *xto = to;
-	size_t temp, temp1;
+	size_t temp;
 
 	if (!n)
 		return xto;
@@ -47,6 +47,7 @@ void *memcpy(void *to, const void *from, size_t n)
 		for (; temp; temp--)
 			*lto++ = *lfrom++;
 #else
+		size_t temp1;
 		asm volatile (
 			"	movel %2,%3\n"
 			"	andw  #7,%3\n"
Signature · 1 line
1.7.0.4