Commit d9ba82c607f1f7b8adb6886871899bab85c459a9

Con Kolivas 2013-04-07T02:21:29

Fix record_temp_fan function in avalon driver. Patch by Xiangfu <xiangfu@openmobilefree.net>

diff --git a/driver-avalon.c b/driver-avalon.c
index 4de52d5..b263d0a 100644
--- a/driver-avalon.c
+++ b/driver-avalon.c
@@ -721,8 +721,6 @@ static void do_avalon_close(struct thr_info *thr)
 
 static inline void record_temp_fan(struct avalon_info *info, struct avalon_result *ar, float *temp_avg)
 {
-	int max;
-
 	info->fan0 = ar->fan0 * AVALON_FAN_FACTOR;
 	info->fan1 = ar->fan1 * AVALON_FAN_FACTOR;
 	info->fan2 = ar->fan2 * AVALON_FAN_FACTOR;
@@ -745,22 +743,12 @@ static inline void record_temp_fan(struct avalon_info *info, struct avalon_resul
 
 	*temp_avg = info->temp2;
 
-	max = info->temp_max;
-	if (info->temp0 > max)
-		max = info->temp0;
-	if (info->temp1 > max)
-		max = info->temp1;
-	if (info->temp2 > max)
-		max = info->temp2;
-	if (max >= 100) {	/* FIXME: fix the root cause on fpga controller firmware */
-		if (opt_debug) {
-			applog(LOG_DEBUG, "Avalon: temp_max: %d", max);
-			hexdump((uint8_t *)ar, AVALON_READ_SIZE);
-		}
-		return;
-	}
-
-	info->temp_max = max;
+	if (info->temp0 > info->temp_max)
+		info->temp_max = info->temp0;
+	if (info->temp1 > info->temp_max)
+		info->temp_max = info->temp1;
+	if (info->temp2 > info->temp_max)
+		info->temp_max = info->temp2;
 }
 
 static inline void adjust_fan(struct avalon_info *info)