Browse Source

gridseed: Fix warnings

Luke Dashjr 12 years ago
parent
commit
606f7e2750
2 changed files with 3 additions and 9 deletions
  1. 1 5
      driver-gridseed.c
  2. 2 4
      gc3355.c

+ 1 - 5
driver-gridseed.c

@@ -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);
 	
@@ -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];
 	
@@ -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)
 	{
@@ -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;
 		}
 	}

+ 2 - 4
gc3355.c

@@ -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)
@@ -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];