Skip to content

Commit

Permalink
gridseed: Fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
luke-jr committed Apr 5, 2014
1 parent 33cf402 commit 606f7e2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
6 changes: 1 addition & 5 deletions driver-gridseed.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ bool gridseed_set_queue_full(const struct cgpu_info * const device, int needwork
static
bool gridseed_thread_init(struct thr_info *master_thr)
{
struct cgpu_info * const device = master_thr->cgpu, *proc;
struct cgpu_info * const device = master_thr->cgpu;
gridseed_set_queue_full(device, 0);
timer_set_now(&master_thr->tv_poll);

Expand Down Expand Up @@ -201,7 +201,6 @@ bool gridseed_set_queue_full(const struct cgpu_info * const device, int needwork
static
bool gridseed_send_work(const struct cgpu_info * const device, struct work *work)
{
struct gc3355_orb_info * const info = device->device_data;
int work_size = opt_scrypt ? 156 : 52;
unsigned char cmd[work_size];

Expand Down Expand Up @@ -356,12 +355,10 @@ static
void gridseed_poll(struct thr_info * const master_thr)
{
struct cgpu_info * const device = master_thr->cgpu;
int fd = device->device_fd;
unsigned char buf[GC3355_READ_SIZE];
int read = 0;
struct timeval tv_timeout;
timer_set_delay_from_now(&tv_timeout, GRIDSEED_LONG_WORK_DELAY_MS * 1000); // X MS
bool timeout = false;

while (!master_thr->work_restart && (read = gc3355_read(device->device_fd, (char *)buf, GC3355_READ_SIZE)) > 0)
{
Expand Down Expand Up @@ -389,7 +386,6 @@ void gridseed_poll(struct thr_info * const master_thr)
{
// allow work to be sent to the device
applog(LOG_DEBUG, "%s poll: timeout met", device->dev_repr);
timeout = true;
break;
}
}
Expand Down
6 changes: 2 additions & 4 deletions gc3355.c
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,8 @@ void gc3355_log_protocol(int fd, const char *buf, size_t size, const char *prefi
{
char hex[(size * 2) + 1];
bin2hex(hex, buf, size);
applog(LOG_DEBUG, "%s fd=%d: DEVPROTO: %s(%3lu) %s", GC3355_CHIP_NAME, fd, prefix, size, hex);
applog(LOG_DEBUG, "%s fd=%d: DEVPROTO: %s(%3lu) %s",
GC3355_CHIP_NAME, fd, prefix, (unsigned long)size, hex);
}

int gc3355_read(int fd, char *buf, size_t size)
Expand Down Expand Up @@ -727,9 +728,6 @@ void gc3355_sha2_prepare_work(unsigned char cmd[52], struct work *work, bool sim

uint32_t gc3355_get_firmware_version(int fd)
{
unsigned char detect_data[16];
int size = sizeof(detect_data);

gc3355_send_cmds(fd, firmware_request_cmd);

char buf[GC3355_READ_SIZE];
Expand Down

0 comments on commit 606f7e2

Please sign in to comment.