Commit 1f08809a7fd132444eeb3b12b1cee4b1c05571da

Con Kolivas 2013-05-26T01:31:20

Only debug and move ram if spare bytes exist in avalon buffer.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
diff --git a/driver-avalon.c b/driver-avalon.c
index 73456b2..69b04ef 100644
--- a/driver-avalon.c
+++ b/driver-avalon.c
@@ -652,9 +652,12 @@ static void avalon_parse_results(struct cgpu_info *avalon, struct avalon_info *i
 		spare = *offset - AVALON_READ_SIZE;
 	else
 		spare = AVALON_READ_SIZE + i;
-	applog(LOG_WARNING, "Avalon: Discarding %d bytes from buffer", spare);
-	*offset -= spare;
-	memmove(buf, buf + spare, *offset);
+	if (spare) {
+		applog(LOG_WARNING, "Avalon: Discarding %d bytes from buffer", spare);
+		*offset -= spare;
+		memmove(buf, buf + spare, *offset);
+	}
+
 	if (!found) {
 		mutex_lock(&info->lock);
 		info->no_matching_work++;