Browse Source

Merge commit '6b714dd' into cg_merges_20130524b

Conflicts:
	findnonce.c
	miner.c
	miner.h
Luke Dashjr 12 years ago
parent
commit
1b027079bb
2 changed files with 13 additions and 7 deletions
  1. 12 7
      miner.c
  2. 1 0
      miner.h

+ 12 - 7
miner.c

@@ -6894,6 +6894,17 @@ void submit_work_async(struct work *work_in, struct timeval *tv_work_found)
 	_submit_work_async(work);
 }
 
+void inc_hw_errors(struct thr_info *thr)
+{
+	mutex_lock(&stats_lock);
+	hw_errors++;
+	thr->cgpu->hw_errors++;
+	mutex_unlock(&stats_lock);
+
+	if (thr->cgpu->drv->hw_error)
+		thr->cgpu->drv->hw_error(thr);
+}
+
 enum test_nonce2_result hashtest2(struct work *work, bool checktarget)
 {
 	uint32_t *hash2_32 = (uint32_t *)&work->hash[0];
@@ -6953,13 +6964,7 @@ void submit_nonce(struct thr_info *thr, struct work *work, uint32_t nonce)
 			struct cgpu_info *cgpu = thr->cgpu;
 			applog(LOG_WARNING, "%"PRIpreprv": invalid nonce - HW error",
 			       cgpu->proc_repr);
-			mutex_lock(&stats_lock);
-			++hw_errors;
-			++thr->cgpu->hw_errors;
-			mutex_unlock(&stats_lock);
-
-			if (thr->cgpu->drv->hw_error)
-				thr->cgpu->drv->hw_error(thr);
+			inc_hw_errors(thr);
 			goto out;
 		}
 	

+ 1 - 0
miner.h

@@ -1220,6 +1220,7 @@ struct work {
 };
 
 extern void get_datestamp(char *, struct timeval *);
+extern void inc_hw_errors(struct thr_info *thr);
 enum test_nonce2_result {
 	TNR_GOOD,
 	TNR_HIGH,