[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] wait: drop wake_up_{all,one}()
- To: Jan Beulich <jbeulich@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
- Date: Tue, 17 Feb 2026 09:47:02 +0000
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=lsVmCRTw0zvpjLHcOGhdoTiubLiylwQbVDOugo9wsVc=; b=UYHjN0JHXaGHchlWChVjUAx5cx1utXJInxIGCqtdLbjR+mtfgAnzR7prMsahflY9EH0d1rQNs3aKCseeIJa2OPzAi7SO4/zeOJ0WWap/y2PmbKlwO1Kl+MNypAp4iv1XspbJH1aJWQEyWzUqJsKr1u8qzd8gwXOfxmaYIGPberNWIK1hWNDlpp5FXbLh4Zi8OBXeVBK3duqH/ZA2gE+OiffuMunzE9ozFILxv1O0o6evENvXnwhfWf11V5NAdzYnJLLPtrJeN8lp5jQcw2EQ44HPrMcGoc5dskPp4AofyihlwaX7C5F0EqjwtVYBtmO1ypLMHvPFjelk15wNmjYRwQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=uOLU55/tXwX6osiaKaqneo+mkQ0mXUK/R4mpbMBJ2zSdBN2MhqIEVxvOqaeWf7zdauvZTaFXBYPfDneOhyKZA/chZW0hDupy4XeebJv+sdWdZhBtvRlvhuLrMKaZqT3hh+u38a20G7qz7hDRlIk/6/viZ6caDZG6hDcMWaTwY0R3F5bO8+szEPVNKhsS5BhB6oDg7j0TkBJJrFEx09oVw352CU/GfXFsyDsj6Oh8k4hVqkHQQVeJFnV2MVssFbUZDj1dH9denEo3V/9GWRNdrWdbnbbsT0Iy9Zmoa4H8gxJOxKOxMN3vWpy+eEQq+DYtz7h+wQ1o6h5eByXzj3QGOQ==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
- Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
- Delivery-date: Tue, 17 Feb 2026 09:47:28 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 17/02/2026 8:35 am, Jan Beulich wrote:
> 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@xxxxxxxx>
>
> --- a/xen/common/wait.c
> +++ b/xen/common/wait.c
> @@ -85,11 +85,6 @@ 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;
> @@ -107,12 +102,7 @@ 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);
> }
The diff looks wonky because you also moved destroy_waitqueue_head(),
despite wake_up_nr() not being static.
Keeping destroy_waitqueue_head() in it's old location will make the diff
smaller and more obvious.
~Andrew
|