From ecfd497467b75ad5fb5ad9207e547e29ecda3191 Mon Sep 17 00:00:00 2001 From: Noel Maersk Date: Sun, 11 May 2014 17:28:25 +0300 Subject: [PATCH] core: remove second-to-last remnants of hotplug. If you grep hotplug, you'll find two more occurences as a function argument, but it's unused. --- miner.h | 2 -- sgminer.c | 23 +++++------------------ 2 files changed, 5 insertions(+), 20 deletions(-) diff --git a/miner.h b/miner.h index 2c97f38f..0777a262 100644 --- a/miner.h +++ b/miner.h @@ -1071,8 +1071,6 @@ extern bool add_pool_details(struct pool *pool, bool live, char *url, char *user #define MAX_RAWINTENSITY 2147483647 #define MAX_RAWINTENSITY_STR "2147483647" -extern bool hotplug_mode; -extern int hotplug_time; extern struct list_head scan_devices; extern int nDevs; extern int hw_errors; diff --git a/sgminer.c b/sgminer.c index 51cd8a14..8fbd7031 100644 --- a/sgminer.c +++ b/sgminer.c @@ -175,10 +175,6 @@ static int input_thr_id; int gpur_thr_id; static int api_thr_id; static int total_control_threads; -bool hotplug_mode; -static int new_devices; -static int new_threads; -int hotplug_time = 5; #if LOCK_TRACKING pthread_mutex_t lockstat_lock; @@ -7842,17 +7838,11 @@ void enable_device(struct cgpu_info *cgpu) devices[cgpu->sgminer_id = sgminer_id_count++] = cgpu; wr_unlock(&devices_lock); - if (hotplug_mode) { - new_threads += cgpu->threads; + mining_threads += cgpu->threads; #ifdef HAVE_CURSES - adj_width(mining_threads + new_threads, &dev_width); + adj_width(mining_threads, &dev_width); #endif - } else { - mining_threads += cgpu->threads; -#ifdef HAVE_CURSES - adj_width(mining_threads, &dev_width); -#endif - } + if (cgpu->drv->drv_id == DRIVER_opencl) { gpu_threads += cgpu->threads; } @@ -7888,17 +7878,14 @@ bool add_cgpu(struct cgpu_info *cgpu) } wr_lock(&devices_lock); - devices = (struct cgpu_info **)realloc(devices, sizeof(struct cgpu_info *) * (total_devices + new_devices + 2)); + devices = (struct cgpu_info **)realloc(devices, sizeof(struct cgpu_info *) * (total_devices + 2)); wr_unlock(&devices_lock); mutex_lock(&stats_lock); cgpu->last_device_valid_work = time(NULL); mutex_unlock(&stats_lock); - if (hotplug_mode) - devices[total_devices + new_devices++] = cgpu; - else - devices[total_devices++] = cgpu; + devices[total_devices++] = cgpu; adjust_mostdevs(); return true;