From 5b22f092d9358cf4c4cac48957af7be0fff2b7de Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Sat, 9 Feb 2013 19:36:38 +1100 Subject: [PATCH] Provide a noop thread_prepare function for drivers that don't use thread_prepare. --- cgminer.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cgminer.c b/cgminer.c index acf3880c..4b33a435 100644 --- a/cgminer.c +++ b/cgminer.c @@ -6384,6 +6384,11 @@ static bool noop_get_stats(struct cgpu_info __maybe_unused *cgpu) return true; } +static bool noop_thread_prepare(struct thr_info __maybe_unused *thr) +{ + return true; +} + /* Fill missing driver api functions with noops */ void fill_device_api(struct cgpu_info *cgpu) { @@ -6397,6 +6402,8 @@ void fill_device_api(struct cgpu_info *cgpu) drv->get_statline = &noop_get_statline; if (!drv->get_stats) drv->get_stats = &noop_get_stats; + if (!drv->thread_prepare) + drv->thread_prepare = &noop_thread_prepare; } void enable_device(struct cgpu_info *cgpu) @@ -6905,7 +6912,7 @@ begin_bench: tq_push(thr->q, &ping); } - if (cgpu->drv->thread_prepare && !cgpu->drv->thread_prepare(thr)) + if (!cgpu->drv->thread_prepare(thr)) continue; thread_reportout(thr);