Message ID | 1486146260-8092-1-git-send-email-peter.maydell@linaro.org |
---|---|
State | New |
Headers | show |
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>
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
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);
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(-)