public inbox for linux-hyperv@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] mshv: Fix compiler warning about cast converting incompatible function type
@ 2026-01-18 17:02 mhkelley58
  2026-01-19  5:32 ` Naman Jain
  0 siblings, 1 reply; 3+ messages in thread
From: mhkelley58 @ 2026-01-18 17:02 UTC (permalink / raw)
  To: kys, haiyangz, wei.liu, decui, longli, linux-hyperv; +Cc: linux-kernel

From: Michael Kelley <mhklinux@outlook.com>

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.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202601170352.qbh3EKH5-lkp@intel.com/
Signed-off-by: Michael Kelley <mhklinux@outlook.com>
---
 drivers/hv/mshv_vtl_main.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/hv/mshv_vtl_main.c b/drivers/hv/mshv_vtl_main.c
index 2cebe9de5a5a..7bbbce009732 100644
--- a/drivers/hv/mshv_vtl_main.c
+++ b/drivers/hv/mshv_vtl_main.c
@@ -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 *ar
 	if (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);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] mshv: Fix compiler warning about cast converting incompatible function type
  2026-01-18 17:02 [PATCH 1/1] mshv: Fix compiler warning about cast converting incompatible function type mhkelley58
@ 2026-01-19  5:32 ` Naman Jain
  2026-02-04  6:08   ` Wei Liu
  0 siblings, 1 reply; 3+ messages in thread
From: Naman Jain @ 2026-01-19  5:32 UTC (permalink / raw)
  To: mhklinux, kys, haiyangz, wei.liu, decui, longli, linux-hyperv
  Cc: linux-kernel



On 1/18/2026 10:32 PM, mhkelley58@gmail.com wrote:
> From: Michael Kelley <mhklinux@outlook.com>
> 
> 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.
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202601170352.qbh3EKH5-lkp@intel.com/
> Signed-off-by: Michael Kelley <mhklinux@outlook.com>
> ---
>   drivers/hv/mshv_vtl_main.c | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/hv/mshv_vtl_main.c b/drivers/hv/mshv_vtl_main.c
> index 2cebe9de5a5a..7bbbce009732 100644
> --- a/drivers/hv/mshv_vtl_main.c
> +++ b/drivers/hv/mshv_vtl_main.c
> @@ -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 *ar
>   	if (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.

Reviewed-by: Naman Jain <namjain@linux.microsoft.com>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/1] mshv: Fix compiler warning about cast converting incompatible function type
  2026-01-19  5:32 ` Naman Jain
@ 2026-02-04  6:08   ` Wei Liu
  0 siblings, 0 replies; 3+ messages in thread
From: Wei Liu @ 2026-02-04  6:08 UTC (permalink / raw)
  To: Naman Jain
  Cc: mhklinux, kys, haiyangz, wei.liu, decui, longli, linux-hyperv,
	linux-kernel

On Mon, Jan 19, 2026 at 11:02:01AM +0530, Naman Jain wrote:
> 
> 
> On 1/18/2026 10:32 PM, mhkelley58@gmail.com wrote:
> > From: Michael Kelley <mhklinux@outlook.com>
> > 
> > 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.
> > 
> > Reported-by: kernel test robot <lkp@intel.com>
> > Closes: https://lore.kernel.org/oe-kbuild-all/202601170352.qbh3EKH5-lkp@intel.com/
> > Signed-off-by: Michael Kelley <mhklinux@outlook.com>
[...]
> 
> Reviewed-by: Naman Jain <namjain@linux.microsoft.com>
> 

Queued.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-02-04  6:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-18 17:02 [PATCH 1/1] mshv: Fix compiler warning about cast converting incompatible function type mhkelley58
2026-01-19  5:32 ` Naman Jain
2026-02-04  6:08   ` Wei Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox