mshv: Fix compiler warning about cast converting incompatible function type
Subsystems (2)
PATCH 1/1 mshv: Fix compiler warning about cast converting incompatible function type
From: Michael Kelley <[email protected]>
In mshv_vtl_sint_ioctl_pause_msg_stream(), the reference to function mshv_vtl_synic_mask_vmbus_sint() is cast to type smp_call_func_t. The cast generates a compiler warning because the function signature of mshv_vtl_synic_mask_vmbus_sint() doesn't match smp_call_func_t.
There's no actual bug here because the mis-matched function signatures are compatible at runtime. Nonetheless, eliminate the compiler warning by changing the function signature of mshv_vtl_synic_mask_vmbus_sint() to match what on_each_cpu() expects. Remove the cast because it is then no longer necessary.
No functional change.
--- drivers/hv/mshv_vtl_main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/hv/mshv_vtl_main.c +3 -2
@@ -845,9 +845,10 @@ static const struct file_operations mshv_vtl_fops = { .mmap = mshv_vtl_mmap, }; -static void mshv_vtl_synic_mask_vmbus_sint (const u8 *mask) +static void mshv_vtl_synic_mask_vmbus_sint (void *info) {union hv_synic_sint sint; +const u8 *mask = info; sint.as_uint64 =0 ; sint.vector =HYPERVISOR_CALLBACK_VECTOR ;
@@ -999,7 +1000,7 @@ static int mshv_vtl_sint_ioctl_pause_msg_stream(struct mshv_sint_mask __user *arif (copy_from_user (&mask, arg,sizeof (mask)))return -EFAULT ;guard (mutex)(&vtl2_vmbus_sint_mask_mutex); -on_each_cpu ((smp_call_func_t )mshv_vtl_synic_mask_vmbus_sint, &mask.mask,1 ); +on_each_cpu (mshv_vtl_synic_mask_vmbus_sint, &mask.mask,1 );WRITE_ONCE (vtl_synic_mask_vmbus_sint_masked, mask.mask !=0 );if (mask.mask)wake_up_interruptible_poll (&fd_wait_queue,EPOLLIN );
Signature · 1 line
2.25.1
Quoted 39 lines · On 1/18/2026 10:32 PM, [email protected] wrote:
From: Michael Kelley <[email protected]>
In
mshv_vtl_sint_ioctl_pause_msg_stream(), the reference to functionmshv_vtl_synic_mask_vmbus_sint()is cast to typesmp_call_func_t. The cast generates a compiler warning because the function signature ofmshv_vtl_synic_mask_vmbus_sint()doesn't matchsmp_call_func_t.There's no actual bug here because the mis-matched function signatures are compatible at runtime. Nonetheless, eliminate the compiler warning by changing the function signature of
mshv_vtl_synic_mask_vmbus_sint()to match whaton_each_cpu()expects. Remove the cast because it is then no longer necessary.No functional change.
Reported-by kernel test robot <[email protected]>Signed-off-by Michael Kelley <[email protected]>--- drivers/hv/mshv_vtl_main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)drivers/hv/mshv_vtl_main.c +2
-1@@ -845,9 +845,10 @@ static const struct file_operations mshv_vtl_fops = { .mmap = mshv_vtl_mmap, }; -static void mshv_vtl_synic_mask_vmbus_sint (const u8 *mask) +static void mshv_vtl_synic_mask_vmbus_sint (void *info) {union hv_synic_sint sint; +const u8 *mask = info; sint.as_uint64 =0 ; sint.vector =HYPERVISOR_CALLBACK_VECTOR ;
drivers/hv/mshv_vtl_main.c static int mshv_vtl_sint_ioctl_pause_msg_stream(struct mshv_sint_mask __user *ar · line 1006
Quoted 8 lines
drivers/hv/mshv_vtl_main.c +1
-1@@ -999,7 +1000,7 @@ static int mshv_vtl_sint_ioctl_pause_msg_stream(struct mshv_sint_mask __user *arif (copy_from_user (&mask, arg,sizeof (mask)))return -EFAULT ;guard (mutex)(&vtl2_vmbus_sint_mask_mutex); -on_each_cpu ((smp_call_func_t )mshv_vtl_synic_mask_vmbus_sint, &mask.mask,1 ); +on_each_cpu (mshv_vtl_synic_mask_vmbus_sint, &mask.mask,1 );WRITE_ONCE (vtl_synic_mask_vmbus_sint_masked, mask.mask !=0 );if (mask.mask)wake_up_interruptible_poll (&fd_wait_queue,EPOLLIN );
Thank you Michael for fixing this.
Wei Liu
maintainerQuoted 21 lines · Naman Jain
Quoted 18 lines · On 1/18/2026 10:32 PM, [email protected] wrote:
From: Michael Kelley <[email protected]>
In
mshv_vtl_sint_ioctl_pause_msg_stream(), the reference to functionmshv_vtl_synic_mask_vmbus_sint()is cast to typesmp_call_func_t. The cast generates a compiler warning because the function signature ofmshv_vtl_synic_mask_vmbus_sint()doesn't matchsmp_call_func_t.There's no actual bug here because the mis-matched function signatures are compatible at runtime. Nonetheless, eliminate the compiler warning by changing the function signature of
mshv_vtl_synic_mask_vmbus_sint()to match whaton_each_cpu()expects. Remove the cast because it is then no longer necessary.No functional change.
Reported-by kernel test robot <[email protected]>Signed-off-by Michael Kelley <[email protected]>
[...]
Quoted 3 lines
Reviewed-by Naman Jain <[email protected]>
Queued.