Forward declare all device drivers in miner.h avoiding the need to export them everywhere else.
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 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117
diff --git a/driver-avalon.c b/driver-avalon.c
index 0223c62..d6cd71d 100644
--- a/driver-avalon.c
+++ b/driver-avalon.c
@@ -52,7 +52,6 @@ int opt_bitburner_core_voltage = BITBURNER_DEFAULT_CORE_VOLTAGE;
bool opt_avalon_auto;
static int option_offset = -1;
-struct device_drv avalon_drv;
static int avalon_init_task(struct avalon_task *at,
uint8_t reset, uint8_t ff, uint8_t fan,
diff --git a/driver-bflsc.c b/driver-bflsc.c
index 26cf0c6..5ace03d 100644
--- a/driver-bflsc.c
+++ b/driver-bflsc.c
@@ -33,8 +33,6 @@ int opt_bflsc_overheat = BFLSC_TEMP_OVERHEAT;
static const char *blank = "";
-struct device_drv bflsc_drv;
-
static enum driver_version drv_ver(struct cgpu_info *bflsc, const char *ver)
{
char *tmp;
diff --git a/driver-bitforce.c b/driver-bitforce.c
index 2132427..f28dc1e 100644
--- a/driver-bitforce.c
+++ b/driver-bitforce.c
@@ -77,8 +77,6 @@
static const char *blank = "";
-struct device_drv bitforce_drv;
-
static void bitforce_initialise(struct cgpu_info *bitforce, bool lock)
{
int err, interface;
diff --git a/driver-bitfury.c b/driver-bitfury.c
index d26ae62..0d72b91 100644
--- a/driver-bitfury.c
+++ b/driver-bitfury.c
@@ -15,7 +15,6 @@
/* Wait longer 1/3 longer than it would take for a full nonce range */
#define BF1WAIT 1600
-struct device_drv bitfury_drv;
static void bitfury_empty_buffer(struct cgpu_info *bitfury)
{
diff --git a/driver-icarus.c b/driver-icarus.c
index 0dbcbb4..0773ad5 100644
--- a/driver-icarus.c
+++ b/driver-icarus.c
@@ -235,8 +235,6 @@ struct ICARUS_INFO {
//
static int option_offset = -1;
-struct device_drv icarus_drv;
-
/*
#define ICA_BUFSIZ (0x200)
diff --git a/driver-modminer.c b/driver-modminer.c
index 8e7f651..3a80986 100644
--- a/driver-modminer.c
+++ b/driver-modminer.c
@@ -87,8 +87,6 @@
// Limit when reducing shares_to_good
#define MODMINER_MIN_BACK 12
-struct device_drv modminer_drv;
-
// 45 noops sent when detecting, in case the device was left in "start job" reading
static const char NOOP[] = MODMINER_PING "\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff";
diff --git a/driver-opencl.c b/driver-opencl.c
index 0e2aba2..b6ad37d 100644
--- a/driver-opencl.c
+++ b/driver-opencl.c
@@ -56,10 +56,6 @@ extern void decay_time(double *f, double fadd);
/**********************************************/
-#ifdef HAVE_OPENCL
-struct device_drv opencl_drv;
-#endif
-
#ifdef HAVE_ADL
extern float gpu_temp(int gpu);
extern int gpu_fanspeed(int gpu);
diff --git a/driver-ztex.c b/driver-ztex.c
index 38c6490..f806717 100644
--- a/driver-ztex.c
+++ b/driver-ztex.c
@@ -31,8 +31,6 @@
#define GOLDEN_BACKLOG 5
-struct device_drv ztex_drv;
-
// Forward declarations
static void ztex_disable(struct thr_info* thr);
static bool ztex_prepare(struct thr_info *thr);
diff --git a/miner.h b/miner.h
index bf932dd..1dddf3d 100644
--- a/miner.h
+++ b/miner.h
@@ -249,7 +249,7 @@ enum drv_driver {
#undef DRIVER_ADD_COMMAND
/* Use DRIVER_PARSE_COMMANDS to generate extern device_drv prototypes */
-#define DRIVER_ADD_COMMAND(X) extern struct device_drv X##_drv;
+#define DRIVER_ADD_COMMAND(X) struct device_drv X##_drv;
DRIVER_PARSE_COMMANDS;
#undef DRIVER_ADD_COMMAND