Skip to contentSkip to conversation

ui/vnc: Drop unused vnc_has_job() and vnc_jobs_clear()

PATCH In review Peter Maydell 3 participants 3 messages Feb 3, 2017 – Feb 6, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ui/vnc: Drop unused vnc_has_job() and vnc_jobs_clear()

The functions vnc_has_job() and vnc_jobs_clear() are never used; remove them.

---

I last had a go at this five years ago:
http://patchwork.ozlabs.org/patch/192335/

Since then vnc_stop_worker_thread() got removed anyway in commit 09526058d, but the vnc_jobs_clear() function that it was the only caller of got left behind.

vnc_has_job() has never been used by anybody, and it's impossible to use in a non-racy way, so drop it too.

 ui/vnc-jobs.h |  2 --
 ui/vnc-jobs.c | 23 -----------------------
 2 files changed, 25 deletions(-)
ui/vnc-jobs.h +0 -2
index 044bf9f..59f66bc 100644
@@ -34,8 +34,6 @@
 VncJob *vnc_job_new(VncState *vs);
 int vnc_job_add_rect(VncJob *job, int x, int y, int w, int h);
 void vnc_job_push(VncJob *job);
-bool vnc_has_job(VncState *vs);
-void vnc_jobs_clear(VncState *vs);
 void vnc_jobs_join(VncState *vs);
 
 void vnc_jobs_consume_buffer(VncState *vs);
ui/vnc-jobs.c +0 -23
index 98ca978..f786777 100644
@@ -128,29 +128,6 @@ static bool vnc_has_job_locked(VncState *vs)
     return false;
 }
 
-bool vnc_has_job(VncState *vs)
-{
-    bool ret;
-
-    vnc_lock_queue(queue);
-    ret = vnc_has_job_locked(vs);
-    vnc_unlock_queue(queue);
-    return ret;
-}
-
-void vnc_jobs_clear(VncState *vs)
-{
-    VncJob *job, *tmp;
-
-    vnc_lock_queue(queue);
-    QTAILQ_FOREACH_SAFE(job, &queue->jobs, next, tmp) {
-        if (job->vs == vs || !vs) {
-            QTAILQ_REMOVE(&queue->jobs, job, next);
-        }
-    }
-    vnc_unlock_queue(queue);
-}
-
 void vnc_jobs_join(VncState *vs)
 {
     vnc_lock_queue(queue);
Signature · 1 line
2.7.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 13 lines · Peter Maydell

The functions vnc_has_job() and vnc_jobs_clear() are never used; remove them.

---

I last had a go at this five years ago:
http://patchwork.ozlabs.org/patch/192335/

Since then vnc_stop_worker_thread() got removed anyway in commit 09526058d, but the vnc_jobs_clear() function that it was the only caller of got left behind.

Quoted 6 lines

vnc_has_job() has never been used by anybody, and it's impossible to use in a non-racy way, so drop it too.

 ui/vnc-jobs.h |  2 --
 ui/vnc-jobs.c | 23 -----------------------
 2 files changed, 25 deletions(-)