public inbox for linux-hyperv@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Drivers: hv: Fix the check for HYPERVISOR_CALLBACK_VECTOR
@ 2025-07-07  8:43 Naman Jain
  2025-07-07 17:58 ` Roman Kisel
  0 siblings, 1 reply; 3+ messages in thread
From: Naman Jain @ 2025-07-07  8:43 UTC (permalink / raw)
  To: K . Y . Srinivasan, Haiyang Zhang, Wei Liu, Dexuan Cui,
	Michael Kelley, Roman Kisel
  Cc: linux-hyperv, linux-kernel, stable, namjain

__is_defined(HYPERVISOR_CALLBACK_VECTOR) would return 1, only if
HYPERVISOR_CALLBACK_VECTOR macro is defined as 1. However its value is
0xf3 and this leads to __is_defined() returning 0. The expectation
was to just check whether this MACRO is defined or not and get 1 if
it's defined. Replace __is_defined with #ifdef blocks instead to
fix it.

Fixes: 1dc5df133b98 ("Drivers: hv: vmbus: Get the IRQ number from DeviceTree")
Cc: stable@kernel.org
Signed-off-by: Naman Jain <namjain@linux.microsoft.com>
---
 drivers/hv/vmbus_drv.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
index 33b524b4eb5e..2ed5a1e89d69 100644
--- a/drivers/hv/vmbus_drv.c
+++ b/drivers/hv/vmbus_drv.c
@@ -2509,7 +2509,7 @@ static int vmbus_acpi_add(struct platform_device *pdev)
 	return 0;
 }
 #endif
-
+#ifndef HYPERVISOR_CALLBACK_VECTOR
 static int vmbus_set_irq(struct platform_device *pdev)
 {
 	struct irq_data *data;
@@ -2534,6 +2534,7 @@ static int vmbus_set_irq(struct platform_device *pdev)
 
 	return 0;
 }
+#endif
 
 static int vmbus_device_add(struct platform_device *pdev)
 {
@@ -2549,11 +2550,11 @@ static int vmbus_device_add(struct platform_device *pdev)
 	if (ret)
 		return ret;
 
-	if (!__is_defined(HYPERVISOR_CALLBACK_VECTOR))
-		ret = vmbus_set_irq(pdev);
+#ifndef HYPERVISOR_CALLBACK_VECTOR
+	ret = vmbus_set_irq(pdev);
 	if (ret)
 		return ret;
-
+#endif
 	for_each_of_range(&parser, &range) {
 		struct resource *res;
 

base-commit: 26ffb3d6f02cd0935fb9fa3db897767beee1cb2a
-- 
2.34.1


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

end of thread, other threads:[~2025-07-09 23:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-07  8:43 [PATCH] Drivers: hv: Fix the check for HYPERVISOR_CALLBACK_VECTOR Naman Jain
2025-07-07 17:58 ` Roman Kisel
2025-07-09 23:24   ` Wei Liu

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