mirror of
https://github.com/GOSTSec/sgminer
synced 2025-08-29 15:22:16 +00:00
Merge pull request #346 from denis2342/ztex
libztex: silenced another warning
This commit is contained in:
commit
c1b0143dac
@ -519,13 +519,13 @@ int libztex_numberOfFpgas(struct libztex_device *ztex) {
|
|||||||
|
|
||||||
int libztex_selectFpga(struct libztex_device *ztex) {
|
int libztex_selectFpga(struct libztex_device *ztex) {
|
||||||
int cnt, fpgacnt = libztex_numberOfFpgas(ztex->root);
|
int cnt, fpgacnt = libztex_numberOfFpgas(ztex->root);
|
||||||
uint16_t number = ztex->fpgaNum;
|
int16_t number = ztex->fpgaNum;
|
||||||
if (number < 0 || number >= fpgacnt) {
|
if (number < 0 || number >= fpgacnt) {
|
||||||
applog(LOG_WARNING, "%s: Trying to select wrong fpga (%d in %d)", ztex->repr, number, fpgacnt);
|
applog(LOG_WARNING, "%s: Trying to select wrong fpga (%d in %d)", ztex->repr, number, fpgacnt);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if (ztex->root->selectedFpga != number && libztex_checkCapability(ztex->root, CAPABILITY_MULTI_FPGA)) {
|
if (ztex->root->selectedFpga != number && libztex_checkCapability(ztex->root, CAPABILITY_MULTI_FPGA)) {
|
||||||
cnt = libusb_control_transfer(ztex->root->hndl, 0x40, 0x51, number, 0, NULL, 0, 500);
|
cnt = libusb_control_transfer(ztex->root->hndl, 0x40, 0x51, (uint16_t)number, 0, NULL, 0, 500);
|
||||||
if (unlikely(cnt < 0)) {
|
if (unlikely(cnt < 0)) {
|
||||||
applog(LOG_ERR, "Ztex check device: Failed to set fpga with err %d", cnt);
|
applog(LOG_ERR, "Ztex check device: Failed to set fpga with err %d", cnt);
|
||||||
return cnt;
|
return cnt;
|
||||||
|
@ -46,7 +46,7 @@ struct libztex_fpgastate {
|
|||||||
struct libztex_device {
|
struct libztex_device {
|
||||||
pthread_mutex_t mutex;
|
pthread_mutex_t mutex;
|
||||||
struct libztex_device *root;
|
struct libztex_device *root;
|
||||||
int fpgaNum;
|
int16_t fpgaNum;
|
||||||
bool valid;
|
bool valid;
|
||||||
struct libusb_device_descriptor descriptor;
|
struct libusb_device_descriptor descriptor;
|
||||||
libusb_device_handle *hndl;
|
libusb_device_handle *hndl;
|
||||||
@ -74,7 +74,7 @@ struct libztex_device {
|
|||||||
double errorRate[256];
|
double errorRate[256];
|
||||||
double maxErrorRate[256];
|
double maxErrorRate[256];
|
||||||
|
|
||||||
int numberOfFpgas;
|
int16_t numberOfFpgas;
|
||||||
int selectedFpga;
|
int selectedFpga;
|
||||||
bool parallelConfigSupport;
|
bool parallelConfigSupport;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user