Provide a blank get_statline for drivers that don't support it.
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
diff --git a/cgminer.c b/cgminer.c
index a325a64..bfc4397 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -1909,8 +1909,7 @@ static void get_statline(char *buf, struct cgpu_info *cgpu)
cgpu->rejected,
cgpu->hw_errors,
cgpu->utility);
- if (cgpu->drv->get_statline)
- cgpu->drv->get_statline(buf, cgpu);
+ cgpu->drv->get_statline(buf, cgpu);
}
static void text_print_status(int thr_id)
@@ -2027,11 +2026,9 @@ static void curses_print_devstatus(int thr_id)
hwwidth, cgpu->hw_errors,
uwidth + 3, cgpu->utility);
- if (cgpu->drv->get_statline) {
- logline[0] = '\0';
- cgpu->drv->get_statline(logline, cgpu);
- wprintw(statuswin, "%s", logline);
- }
+ logline[0] = '\0';
+ cgpu->drv->get_statline(logline, cgpu);
+ wprintw(statuswin, "%s", logline);
wclrtoeol(statuswin);
}
@@ -6370,15 +6367,19 @@ extern struct device_drv ztex_drv;
static int cgminer_id_count = 0;
-void noop_reinit_device(struct cgpu_info __maybe_unused *cgpu)
+static void noop_reinit_device(struct cgpu_info __maybe_unused *cgpu)
{
}
-void blank_get_statline_before(char *buf, struct cgpu_info __maybe_unused *cgpu)
+static void blank_get_statline_before(char *buf, struct cgpu_info __maybe_unused *cgpu)
{
tailsprintf(buf, " | ");
}
+static void noop_get_statline(char __maybe_unused *buf, struct cgpu_info __maybe_unused *cgpu)
+{
+}
+
/* Fill missing driver api functions with noops */
void fill_device_api(struct cgpu_info *cgpu)
{
@@ -6388,6 +6389,8 @@ void fill_device_api(struct cgpu_info *cgpu)
drv->reinit_device = &noop_reinit_device;
if (!drv->get_statline_before)
drv->get_statline_before = &blank_get_statline_before;
+ if (!drv->get_statline)
+ drv->get_statline = &noop_get_statline;
}
void enable_device(struct cgpu_info *cgpu)