Skip to content

Commit ecfd497

Browse files
committed
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.
1 parent e32dcd7 commit ecfd497

File tree

2 files changed

+5
-20
lines changed

2 files changed

+5
-20
lines changed

miner.h

-2
Original file line numberDiff line numberDiff line change
@@ -1071,8 +1071,6 @@ extern bool add_pool_details(struct pool *pool, bool live, char *url, char *user
10711071
#define MAX_RAWINTENSITY 2147483647
10721072
#define MAX_RAWINTENSITY_STR "2147483647"
10731073

1074-
extern bool hotplug_mode;
1075-
extern int hotplug_time;
10761074
extern struct list_head scan_devices;
10771075
extern int nDevs;
10781076
extern int hw_errors;

sgminer.c

+5-18
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,6 @@ static int input_thr_id;
175175
int gpur_thr_id;
176176
static int api_thr_id;
177177
static int total_control_threads;
178-
bool hotplug_mode;
179-
static int new_devices;
180-
static int new_threads;
181-
int hotplug_time = 5;
182178

183179
#if LOCK_TRACKING
184180
pthread_mutex_t lockstat_lock;
@@ -7842,17 +7838,11 @@ void enable_device(struct cgpu_info *cgpu)
78427838
devices[cgpu->sgminer_id = sgminer_id_count++] = cgpu;
78437839
wr_unlock(&devices_lock);
78447840

7845-
if (hotplug_mode) {
7846-
new_threads += cgpu->threads;
7841+
mining_threads += cgpu->threads;
78477842
#ifdef HAVE_CURSES
7848-
adj_width(mining_threads + new_threads, &dev_width);
7843+
adj_width(mining_threads, &dev_width);
78497844
#endif
7850-
} else {
7851-
mining_threads += cgpu->threads;
7852-
#ifdef HAVE_CURSES
7853-
adj_width(mining_threads, &dev_width);
7854-
#endif
7855-
}
7845+
78567846
if (cgpu->drv->drv_id == DRIVER_opencl) {
78577847
gpu_threads += cgpu->threads;
78587848
}
@@ -7888,17 +7878,14 @@ bool add_cgpu(struct cgpu_info *cgpu)
78887878
}
78897879

78907880
wr_lock(&devices_lock);
7891-
devices = (struct cgpu_info **)realloc(devices, sizeof(struct cgpu_info *) * (total_devices + new_devices + 2));
7881+
devices = (struct cgpu_info **)realloc(devices, sizeof(struct cgpu_info *) * (total_devices + 2));
78927882
wr_unlock(&devices_lock);
78937883

78947884
mutex_lock(&stats_lock);
78957885
cgpu->last_device_valid_work = time(NULL);
78967886
mutex_unlock(&stats_lock);
78977887

7898-
if (hotplug_mode)
7899-
devices[total_devices + new_devices++] = cgpu;
7900-
else
7901-
devices[total_devices++] = cgpu;
7888+
devices[total_devices++] = cgpu;
79027889

79037890
adjust_mostdevs();
79047891
return true;

0 commit comments

Comments
 (0)