mshv: Store the result of vfs_poll in a variable of type __poll_t
Subsystems (2)
PATCH 1/1 mshv: Store the result of vfs_poll in a variable of type __poll_t
From: Michael Kelley <[email protected]>
vfs_poll() returns a result of type __poll_t, but current code is using an "unsigned int" local variable. The difference is that __poll_t carries the "bitwise" attribute. This attribute is not interpreted by the C compiler; it is only used by 'sparse' to flag incorrect usage of the return value. The return value is used correctly here, so there's no bug, but sparse complains about the type mismatch.
In the interest of general correctness and to avoid noise from sparse, change the local variable to type __poll_t. No functional change.
---
This change is not marked with a Fixes: tag as there's no value in backporting to older stable releases.
drivers/hv/mshv_eventfd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hv/mshv_eventfd.c +1 -1
@@ -388,7 +388,7 @@ static int mshv_irqfd_assign(struct mshv_partition *pt, {struct eventfd_ctx *eventfd =NULL , *resamplefd =NULL ;struct mshv_irqfd *irqfd, *tmp; -unsigned int events; +__poll_t events;int ret;int idx;
Signature · 1 line
2.25.1
Quoted 27 lines · On 1/14/2026 9:01 AM, [email protected] wrote:
From: Michael Kelley <[email protected]>
vfs_poll()returns a result of type__poll_t, but current code is using an "unsigned int" local variable. The difference is that__poll_tcarries the "bitwise" attribute. This attribute is not interpreted by the C compiler; it is only used by 'sparse' to flag incorrect usage of the return value. The return value is used correctly here, so there's no bug, but sparse complains about the type mismatch.In the interest of general correctness and to avoid noise from sparse, change the local variable to type
__poll_t. No functional change.Reported-by kernel test robot <[email protected]>Signed-off-by Michael Kelley <[email protected]>---
This change is not marked with a Fixes: tag as there's no value in backporting to older stable releases.drivers/hv/mshv_eventfd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/hv/mshv_eventfd.c +0
-0
drivers/hv/mshv_eventfd.c static int mshv_irqfd_assign(struct mshv_partition *pt, · line 394
Quoted 8 lines
drivers/hv/mshv_eventfd.c +1
-1@@ -388,7 +388,7 @@ static int mshv_irqfd_assign(struct mshv_partition *pt, {struct eventfd_ctx *eventfd =NULL , *resamplefd =NULL ;struct mshv_irqfd *irqfd, *tmp; -unsigned int events; +__poll_t events;int ret;int idx;
Quoted 23 lines · Nuno Das Neves
Quoted 22 lines · On 1/14/2026 9:01 AM, [email protected] wrote:
From: Michael Kelley <[email protected]>
vfs_poll()returns a result of type__poll_t, but current code is using an "unsigned int" local variable. The difference is that__poll_tcarries the "bitwise" attribute. This attribute is not interpreted by the C compiler; it is only used by 'sparse' to flag incorrect usage of the return value. The return value is used correctly here, so there's no bug, but sparse complains about the type mismatch.In the interest of general correctness and to avoid noise from sparse, change the local variable to type
__poll_t. No functional change.Reported-by kernel test robot <[email protected]>Signed-off-by Michael Kelley <[email protected]>---
This change is not marked with a Fixes: tag as there's no value in backporting to older stable releases.drivers/hv/mshv_eventfd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 15 lines
drivers/hv/mshv_eventfd.c static int mshv_irqfd_assign(struct mshv_partition *pt, · line 394
Quoted 13 lines
drivers/hv/mshv_eventfd.c +1
-1@@ -388,7 +388,7 @@ static int mshv_irqfd_assign(struct mshv_partition *pt, {struct eventfd_ctx *eventfd =NULL , *resamplefd =NULL ;struct mshv_irqfd *irqfd, *tmp; -unsigned int events; +__poll_t events;int ret;int idx;Reviewed-by Nuno Das Neves <[email protected]>
Applied.