qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] ui/vnc: Drop unused vnc_has_job() and vnc_jobs_clear()
@ 2017-02-03 18:24 Peter Maydell
  2017-02-06  3:36 ` Gonglei
  2017-02-06 12:47 ` Gerd Hoffmann
  0 siblings, 2 replies; 3+ messages in thread
From: Peter Maydell @ 2017-02-03 18:24 UTC (permalink / raw)
  To: qemu-devel; +Cc: patches, Gerd Hoffmann, Paolo Bonzini

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

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---

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(-)

diff --git a/ui/vnc-jobs.h b/ui/vnc-jobs.h
index 044bf9f..59f66bc 100644
--- a/ui/vnc-jobs.h
+++ b/ui/vnc-jobs.h
@@ -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);
diff --git a/ui/vnc-jobs.c b/ui/vnc-jobs.c
index 98ca978..f786777 100644
--- a/ui/vnc-jobs.c
+++ b/ui/vnc-jobs.c
@@ -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);
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] ui/vnc: Drop unused vnc_has_job() and vnc_jobs_clear()
  2017-02-03 18:24 [Qemu-devel] [PATCH] ui/vnc: Drop unused vnc_has_job() and vnc_jobs_clear() Peter Maydell
@ 2017-02-06  3:36 ` Gonglei
  2017-02-06 12:47 ` Gerd Hoffmann
  1 sibling, 0 replies; 3+ messages in thread
From: Gonglei @ 2017-02-06  3:36 UTC (permalink / raw)
  To: Peter Maydell, qemu-devel; +Cc: Paolo Bonzini, Gerd Hoffmann, patches



On 2017/2/4 2:24, Peter Maydell wrote:
> The functions vnc_has_job() and vnc_jobs_clear() are
> never used; remove them.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> 
> 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(-)

Reviewed-by: Gonglei <arei.gonglei@huawei.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] ui/vnc: Drop unused vnc_has_job() and vnc_jobs_clear()
  2017-02-03 18:24 [Qemu-devel] [PATCH] ui/vnc: Drop unused vnc_has_job() and vnc_jobs_clear() Peter Maydell
  2017-02-06  3:36 ` Gonglei
@ 2017-02-06 12:47 ` Gerd Hoffmann
  1 sibling, 0 replies; 3+ messages in thread
From: Gerd Hoffmann @ 2017-02-06 12:47 UTC (permalink / raw)
  To: Peter Maydell; +Cc: qemu-devel, patches, Paolo Bonzini

On Fr, 2017-02-03 at 18:24 +0000, Peter Maydell wrote:
> The functions vnc_has_job() and vnc_jobs_clear() are
> never used; remove them.

Added to ui patch queue.

thanks,
  Gerd

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-02-06 12:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-03 18:24 [Qemu-devel] [PATCH] ui/vnc: Drop unused vnc_has_job() and vnc_jobs_clear() Peter Maydell
2017-02-06  3:36 ` Gonglei
2017-02-06 12:47 ` Gerd Hoffmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).