:p
atchew
Login
wake_up_one() isn't used at all, so violates Misra rule 2.1 (unreachable code). wake_up_all() is only used locally, yet rather than making it static its sole user can invoke wake_up_nr() in the intended way directly. Signed-off-by: Jan Beulich <jbeulich@suse.com> --- a/xen/common/wait.c +++ b/xen/common/wait.c @@ -XXX,XX +XXX,XX @@ void init_waitqueue_head(struct waitqueu INIT_LIST_HEAD(&wq->list); } -void destroy_waitqueue_head(struct waitqueue_head *wq) -{ - wake_up_all(wq); -} - void wake_up_nr(struct waitqueue_head *wq, unsigned int nr) { struct waitqueue_vcpu *wqv; @@ -XXX,XX +XXX,XX @@ void wake_up_nr(struct waitqueue_head *w spin_unlock(&wq->lock); } -void wake_up_one(struct waitqueue_head *wq) -{ - wake_up_nr(wq, 1); -} - -void wake_up_all(struct waitqueue_head *wq) +void destroy_waitqueue_head(struct waitqueue_head *wq) { wake_up_nr(wq, UINT_MAX); } --- a/xen/include/xen/wait.h +++ b/xen/include/xen/wait.h @@ -XXX,XX +XXX,XX @@ void destroy_waitqueue_head(struct waitq /* Wake VCPU(s) waiting on specified waitqueue. */ void wake_up_nr(struct waitqueue_head *wq, unsigned int nr); -void wake_up_one(struct waitqueue_head *wq); -void wake_up_all(struct waitqueue_head *wq); /* Wait on specified waitqueue until @condition is true. */ #define wait_event(wq, condition) \
wake_up_one() isn't used at all, so violates Misra rule 2.1 (unreachable code). wake_up_all() is only used locally, yet rather than making it static its sole user can invoke wake_up_nr() in the intended way directly. Signed-off-by: Jan Beulich <jbeulich@suse.com> --- v2: Keep destroy_waitqueue_head() at its old position. --- a/xen/common/wait.c +++ b/xen/common/wait.c @@ -XXX,XX +XXX,XX @@ void init_waitqueue_head(struct waitqueu void destroy_waitqueue_head(struct waitqueue_head *wq) { - wake_up_all(wq); + wake_up_nr(wq, UINT_MAX); } void wake_up_nr(struct waitqueue_head *wq, unsigned int nr) @@ -XXX,XX +XXX,XX @@ void wake_up_nr(struct waitqueue_head *w spin_unlock(&wq->lock); } -void wake_up_one(struct waitqueue_head *wq) -{ - wake_up_nr(wq, 1); -} - -void wake_up_all(struct waitqueue_head *wq) -{ - wake_up_nr(wq, UINT_MAX); -} - #ifdef CONFIG_X86 static void __prepare_to_wait(struct waitqueue_vcpu *wqv) --- a/xen/include/xen/wait.h +++ b/xen/include/xen/wait.h @@ -XXX,XX +XXX,XX @@ void destroy_waitqueue_head(struct waitq /* Wake VCPU(s) waiting on specified waitqueue. */ void wake_up_nr(struct waitqueue_head *wq, unsigned int nr); -void wake_up_one(struct waitqueue_head *wq); -void wake_up_all(struct waitqueue_head *wq); /* Wait on specified waitqueue until @condition is true. */ #define wait_event(wq, condition) \