A1: clean up compile warnings
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
diff --git a/driver-SPI-bitmine-A1.c b/driver-SPI-bitmine-A1.c
index 93a3d40..2ff4fc3 100644
--- a/driver-SPI-bitmine-A1.c
+++ b/driver-SPI-bitmine-A1.c
@@ -222,7 +222,7 @@ static uint8_t *exec_cmd(struct A1_chain *a1,
if (data != NULL)
memcpy(a1->spi_tx + 2, data, len);
- bool retval = spi_transfer(a1->spi_ctx, a1->spi_tx, a1->spi_rx, tx_len);
+ assert(spi_transfer(a1->spi_ctx, a1->spi_tx, a1->spi_rx, tx_len));
hexdump("send: TX", a1->spi_tx, tx_len);
hexdump("send: RX", a1->spi_rx, tx_len);
@@ -279,20 +279,19 @@ static uint8_t *cmd_READ_RESULT_BCAST(struct A1_chain *a1)
memset(a1->spi_tx, 0, tx_len);
a1->spi_tx[0] = A1_READ_RESULT;
- bool retval = spi_transfer(a1->spi_ctx, a1->spi_tx, a1->spi_rx, tx_len);
+ assert(spi_transfer(a1->spi_ctx, a1->spi_tx, a1->spi_rx, tx_len));
hexdump("send: TX", a1->spi_tx, tx_len);
hexdump("send: RX", a1->spi_rx, tx_len);
int poll_len = tx_len + 4 * a1->num_chips;
- retval = spi_transfer(a1->spi_ctx, NULL, a1->spi_rx + tx_len, poll_len);
+ assert(spi_transfer(a1->spi_ctx, NULL, a1->spi_rx + tx_len, poll_len));
hexdump("poll: RX", a1->spi_rx + tx_len, poll_len);
uint8_t *scan = a1->spi_rx;
int i;
for (i = 0; i < poll_len; i += 2) {
- if ((scan[i] & 0x0f) == A1_READ_RESULT) {
+ if ((scan[i] & 0x0f) == A1_READ_RESULT)
return scan + i;
- }
}
applog(LOG_ERR, "%d: cmd_READ_RESULT_BCAST failed", a1->board_id);
return NULL;
@@ -323,20 +322,18 @@ static uint8_t *cmd_READ_REG(struct A1_chain *a1, uint8_t chip)
static uint8_t *cmd_WRITE_JOB(struct A1_chain *a1, uint8_t chip_id,
uint8_t *job)
{
-
- uint8_t cmd = (a1->spi_tx[0] << 8) | a1->spi_tx[1];
/* ensure we push the SPI command to the last chip in chain */
int tx_len = WRITE_JOB_LENGTH + 2;
memcpy(a1->spi_tx, job, WRITE_JOB_LENGTH);
memset(a1->spi_tx + WRITE_JOB_LENGTH, 0, tx_len - WRITE_JOB_LENGTH);
- bool retval = spi_transfer(a1->spi_ctx, a1->spi_tx, a1->spi_rx, tx_len);
+ assert(spi_transfer(a1->spi_ctx, a1->spi_tx, a1->spi_rx, tx_len));
hexdump("send: TX", a1->spi_tx, tx_len);
hexdump("send: RX", a1->spi_rx, tx_len);
int poll_len = 4 * chip_id - 2;
- retval = spi_transfer(a1->spi_ctx, NULL, a1->spi_rx + tx_len, poll_len);
+ assert(spi_transfer(a1->spi_ctx, NULL, a1->spi_rx + tx_len, poll_len));
hexdump("poll: RX", a1->spi_rx + tx_len, poll_len);
int ack_len = tx_len;
@@ -845,7 +842,6 @@ void A1_detect(bool hotplug)
{
int bus;
int cs_line;
- int board_id;
/* no hotplug support for now */
if (hotplug)
@@ -1017,7 +1013,6 @@ static bool A1_queue_full(struct cgpu_info *cgpu)
{
struct A1_chain *a1 = cgpu->device_data;
int queue_full = false;
- struct work *work;
mutex_lock(&a1->lock);
applog(LOG_DEBUG, "%d, A1 running queue_full: %d/%d",