get_work always returns true so turn it into a void function.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
diff --git a/cgminer.c b/cgminer.c
index 523b5aa..41476f5 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -4002,13 +4002,12 @@ static struct work *clone_work(struct work *work)
return work;
}
-static bool get_work(struct work *work, struct thr_info *thr, const int thr_id)
+static void get_work(struct work *work, struct thr_info *thr, const int thr_id)
{
struct timespec abstime = {0, 0};
struct work *work_heap;
struct timeval now;
struct pool *pool;
- bool ret = false;
/* Tell the watchdog thread this thread is waiting on getwork and
* should not be restarted */
@@ -4016,17 +4015,14 @@ static bool get_work(struct work *work, struct thr_info *thr, const int thr_id)
if (opt_benchmark) {
get_benchmark_work(work);
- thread_reportin(thr);
- return true;
+ goto out;
}
retry:
pool = current_pool();
- if (reuse_work(work)) {
- ret = true;
+ if (reuse_work(work))
goto out;
- }
if (!pool->lagging && !total_staged() && global_queued() >= mining_threads + opt_queue) {
struct cgpu_info *cgpu = thr->cgpu;
@@ -4080,14 +4076,10 @@ retry:
memcpy(work, work_heap, sizeof(struct work));
free_work(work_heap);
- ret = true;
out:
-
work->thr_id = thr_id;
thread_reportin(thr);
- if (ret)
- work->mined = true;
- return ret;
+ work->mined = true;
}
bool submit_work_sync(struct thr_info *thr, const struct work *work_in)
@@ -4244,11 +4236,8 @@ void *miner_thread(void *userdata)
mythr->work_restart = false;
if (api->free_work && likely(work->pool))
api->free_work(mythr, work);
- if (unlikely(!get_work(work, mythr, thr_id))) {
- applog(LOG_ERR, "work retrieval failed, exiting "
- "mining thread %d", thr_id);
- break;
- }
+ get_work(work, mythr, thr_id);
+
gettimeofday(&tv_workstart, NULL);
work->blk.nonce = 0;
cgpu->max_hashes = 0;