mirror of
https://github.com/GOSTSec/sgminer
synced 2025-03-13 06:01:03 +00:00
Provide a noop prepare_work for drivers that don't support it.
This commit is contained in:
parent
b9f5b48c08
commit
210537198c
@ -5406,7 +5406,7 @@ void *miner_thread(void *userdata)
|
||||
gettimeofday(&tv_workstart, NULL);
|
||||
work->blk.nonce = 0;
|
||||
cgpu->max_hashes = 0;
|
||||
if (drv->prepare_work && !drv->prepare_work(mythr, work)) {
|
||||
if (!drv->prepare_work(mythr, work)) {
|
||||
applog(LOG_ERR, "work prepare failed, exiting "
|
||||
"mining thread %d", thr_id);
|
||||
break;
|
||||
@ -6399,6 +6399,11 @@ static bool noop_thread_init(struct thr_info __maybe_unused *thr)
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool noop_prepare_work(struct thr_info __maybe_unused *thr, struct work __maybe_unused *work)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Fill missing driver api functions with noops */
|
||||
void fill_device_api(struct cgpu_info *cgpu)
|
||||
{
|
||||
@ -6418,6 +6423,8 @@ void fill_device_api(struct cgpu_info *cgpu)
|
||||
drv->can_limit_work = &noop_can_limit_work;
|
||||
if (!drv->thread_init)
|
||||
drv->thread_init = &noop_thread_init;
|
||||
if (!drv->prepare_work)
|
||||
drv->prepare_work = &noop_prepare_work;
|
||||
}
|
||||
|
||||
void enable_device(struct cgpu_info *cgpu)
|
||||
|
Loading…
x
Reference in New Issue
Block a user