Browse Source

work queues - remove new but unnecessary functions

Conflicts:
	miner.h
Kano 13 years ago
parent
commit
60792d877d
2 changed files with 3 additions and 21 deletions
  1. 2 18
      miner.c
  2. 1 3
      miner.h

+ 2 - 18
miner.c

@@ -6991,28 +6991,12 @@ struct work *get_queued(struct cgpu_info *cgpu)
 	return ret;
 	return ret;
 }
 }
 
 
-/* This function is for including work in the given que hashtable.
- * The calling function must lock access to the que if it is required. */
-struct work *add_to_work_que(struct work *que, struct work *work)
-{
-	HASH_ADD_INT(que, id, work);
-	return que;
-}
-
-/* This function is for removing work from the given que hashtable.
- * The calling function must lock access to the que if it is required. */
-struct work *del_from_work_que(struct work *que, struct work *work)
-{
-	HASH_DEL(que, work);
-	return que;
-}
-
 /* This function is for finding an already queued work item in the
 /* This function is for finding an already queued work item in the
  * given que hashtable. Code using this function must be able
  * given que hashtable. Code using this function must be able
  * to handle NULL as a return which implies there is no matching work.
  * to handle NULL as a return which implies there is no matching work.
  * The calling function must lock access to the que if it is required.
  * The calling function must lock access to the que if it is required.
  * The common values for midstatelen, offset, datalen are 32, 64, 12 */
  * The common values for midstatelen, offset, datalen are 32, 64, 12 */
-struct work *find_work_bymidstate(struct work *que, char *midstate, size_t midstatelen, char *data, int offset, size_t datalen)
+struct work *__find_work_bymidstate(struct work *que, char *midstate, size_t midstatelen, char *data, int offset, size_t datalen)
 {
 {
 	struct work *work, *tmp, *ret = NULL;
 	struct work *work, *tmp, *ret = NULL;
 
 
@@ -7037,7 +7021,7 @@ struct work *find_queued_work_bymidstate(struct cgpu_info *cgpu, char *midstate,
 	struct work *ret;
 	struct work *ret;
 
 
 	rd_lock(&cgpu->qlock);
 	rd_lock(&cgpu->qlock);
-	ret = find_work_bymidstate(cgpu->queued_work, midstate, midstatelen, data, offset, datalen);
+	ret = __find_work_bymidstate(cgpu->queued_work, midstate, midstatelen, data, offset, datalen);
 	rd_unlock(&cgpu->qlock);
 	rd_unlock(&cgpu->qlock);
 
 
 	return ret;
 	return ret;

+ 1 - 3
miner.h

@@ -1156,9 +1156,7 @@ extern enum test_nonce2_result _test_nonce2(struct work *, uint32_t nonce, bool
 #define test_nonce2(work, nonce)  (_test_nonce2(work, nonce, true))
 #define test_nonce2(work, nonce)  (_test_nonce2(work, nonce, true))
 extern void submit_nonce(struct thr_info *thr, struct work *work, uint32_t nonce);
 extern void submit_nonce(struct thr_info *thr, struct work *work, uint32_t nonce);
 extern struct work *get_queued(struct cgpu_info *cgpu);
 extern struct work *get_queued(struct cgpu_info *cgpu);
-extern struct work *add_to_work_que(struct work *que, struct work *work);
-extern struct work *del_from_work_que(struct work *que, struct work *work);
-extern struct work *find_work_bymidstate(struct work *que, char *midstate, size_t midstatelen, char *data, int offset, size_t datalen);
+extern struct work *__find_work_bymidstate(struct work *que, char *midstate, size_t midstatelen, char *data, int offset, size_t datalen);
 struct work *find_queued_work_bymidstate(struct cgpu_info *cgpu, char *midstate, size_t midstatelen, char *data, int offset, size_t datalen);
 struct work *find_queued_work_bymidstate(struct cgpu_info *cgpu, char *midstate, size_t midstatelen, char *data, int offset, size_t datalen);
 extern void work_completed(struct cgpu_info *cgpu, struct work *work);
 extern void work_completed(struct cgpu_info *cgpu, struct work *work);
 extern bool abandon_work(struct work *, struct timeval *work_runtime, uint64_t hashes);
 extern bool abandon_work(struct work *, struct timeval *work_runtime, uint64_t hashes);