diff --git a/driver-klondike.c b/driver-klondike.c index 8480d949..0ebdd7aa 100644 --- a/driver-klondike.c +++ b/driver-klondike.c @@ -147,7 +147,7 @@ static char *SendCmdGetReply(struct cgpu_info *klncgpu, char Cmd, int device, in chkreply = 0; if (chkreply == klninfo->nextreply) break; - } + } if (chkreply == klninfo->nextreply) continue; *(klninfo->replies + chkreply*REPLY_BUFSIZE) = '!'; // mark to prevent re-use @@ -173,7 +173,7 @@ static bool klondike_get_stats(struct cgpu_info *klncgpu) char *reply = SendCmdGetReply(klncgpu, 'S', dev, 0, NULL); if (reply != NULL) klninfo->status[dev] = *(WORKSTATUS *)(reply+2); - } + } wr_unlock(&(klninfo->stat_lock)); // todo: detect slavecount change and realloc space @@ -204,7 +204,7 @@ static bool klondike_init(struct cgpu_info *klncgpu) klninfo->cfg = calloc(slaves+1, sizeof(WORKCFG)); if (unlikely(!klninfo->cfg)) quit(1, "Failed to calloc cfg array in klondke_get_stats"); - } + } WORKCFG cfgset = { 0,0,0,0,0 }; // zero init triggers read back only double temp1, temp2; @@ -227,8 +227,8 @@ static bool klondike_init(struct cgpu_info *klncgpu) cvtKlnToC(klninfo->cfg[dev].temptarget), cvtKlnToC(klninfo->cfg[dev].tempcritical), (int)100*klninfo->cfg[dev].fantarget/256); - } } + } klondike_get_stats(klncgpu); for (dev = 0; dev <= slaves; dev++) { klninfo->devinfo[dev].rangesize = ((uint64_t)1<<32) / klninfo->status[dev].chipcount; @@ -285,7 +285,7 @@ static bool klondike_detect_one(struct libusb_device *dev, struct usb_find_devic break; applog(LOG_DEBUG, "Klondike cgpu added"); return true; - } + } } usb_uninit(klncgpu); } @@ -325,8 +325,8 @@ static void klondike_check_nonce(struct cgpu_info *klncgpu, WORKRESULT *result) applog(LOG_DEBUG, "Klondike chip stats %d, %08x, %d, %d", result->device, result->nonce, klninfo->devinfo[result->device].rangesize, klninfo->status[result->device].chipcount); klninfo->devinfo[result->device].chipstats[(result->nonce / klninfo->devinfo[result->device].rangesize) + (ok ? 0 : klninfo->status[result->device].chipcount)]++; return; - } } + } applog(LOG_ERR, "%s%i:%d unknown work (%02x:%08x) - ignored", klncgpu->drv->name, klncgpu->device_id, result->device, result->workid, result->nonce); @@ -452,10 +452,10 @@ static bool klondike_send_work(struct cgpu_info *klncgpu, int dev, struct work * work->subid = dev*256 + data.workid; if (opt_log_level <= LOG_DEBUG) { - char *hexdata = bin2hex(&data.workid, sizeof(data)-3); - applog(LOG_DEBUG, "WORKDATA: %s", hexdata); - free(hexdata); - } + char *hexdata = bin2hex(&data.workid, sizeof(data)-3); + applog(LOG_DEBUG, "WORKDATA: %s", hexdata); + free(hexdata); + } applog(LOG_DEBUG, "Klondike sending work (%d:%02x)", dev, data.workid); char *reply = SendCmdGetReply(klncgpu, 'W', dev, sizeof(data)-3, &data.workid); @@ -518,7 +518,6 @@ static int64_t klondike_scanwork(struct thr_info *thr) newhashcount += (newhashdev << 32) / klninfo->status[dev].maxcount; // todo: check stats for critical conditions - } rd_unlock(&(klninfo->stat_lock)); } @@ -541,7 +540,7 @@ static void get_klondike_statline_before(char *buf, size_t siz, struct cgpu_info if (klninfo->status[dev].temp < temp) temp = klninfo->status[dev].temp; fan += klninfo->cfg[dev].fantarget; - } + } fan /= klninfo->status->slavecount+1; rd_unlock(&(klninfo->stat_lock));