Skip to content

Commit b0871aa

Browse files
Naman Jainliuw
authored andcommitted
Drivers: hv: Fix the check for HYPERVISOR_CALLBACK_VECTOR
__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: 1dc5df1 ("Drivers: hv: vmbus: Get the IRQ number from DeviceTree") Cc: [email protected] Signed-off-by: Naman Jain <[email protected]> Reviewed-by: Roman Kisel <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Wei Liu <[email protected]> Message-ID: <[email protected]>
1 parent 0d86a8d commit b0871aa

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

drivers/hv/vmbus_drv.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2509,7 +2509,7 @@ static int vmbus_acpi_add(struct platform_device *pdev)
25092509
return 0;
25102510
}
25112511
#endif
2512-
2512+
#ifndef HYPERVISOR_CALLBACK_VECTOR
25132513
static int vmbus_set_irq(struct platform_device *pdev)
25142514
{
25152515
struct irq_data *data;
@@ -2534,6 +2534,7 @@ static int vmbus_set_irq(struct platform_device *pdev)
25342534

25352535
return 0;
25362536
}
2537+
#endif
25372538

25382539
static int vmbus_device_add(struct platform_device *pdev)
25392540
{
@@ -2549,11 +2550,11 @@ static int vmbus_device_add(struct platform_device *pdev)
25492550
if (ret)
25502551
return ret;
25512552

2552-
if (!__is_defined(HYPERVISOR_CALLBACK_VECTOR))
2553-
ret = vmbus_set_irq(pdev);
2553+
#ifndef HYPERVISOR_CALLBACK_VECTOR
2554+
ret = vmbus_set_irq(pdev);
25542555
if (ret)
25552556
return ret;
2556-
2557+
#endif
25572558
for_each_of_range(&parser, &range) {
25582559
struct resource *res;
25592560

0 commit comments

Comments
 (0)