Drivers: hv: Fix the check for HYPERVISOR_CALLBACK_VECTOR
Subsystems (2)
PATCH 1/1 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.
--- drivers/hv/vmbus_drv.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/hv/vmbus_drv.c +5 -4
@@ -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
Signature · 1 line
2.34.1
Quoted 11 lines · Naman Jain
__is_defined(HYPERVISOR_CALLBACK_VECTOR)would return 1, only ifHYPERVISOR_CALLBACK_VECTORmacro is defined as 1. However its value is0xf3and 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_definedwith #ifdef blocks instead to fix it.Fixes 1dc5df133b98 ("Drivers: hv: vmbus: Get the IRQ number from DeviceTree")Signed-off-by Naman Jain <[email protected]>---
[...]
Appreciate fixing that! From what I learned from you, x86 was broken. Very likely I did a smoke test there only while focusing on arm64. Sorry about that, thanks again!!
LGTM.
Quoted 3 lines
base-commit:
26ffb3d6f02cd0935fb9fa3db897767beee1cb2a
Signature · 2 lines
Thank you, Roman
Quoted 15 lines · Roman Kisel
Quoted 11 lines · Naman Jain
__is_defined(HYPERVISOR_CALLBACK_VECTOR)would return 1, only ifHYPERVISOR_CALLBACK_VECTORmacro is defined as 1. However its value is0xf3and 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_definedwith #ifdef blocks instead to fix it.Fixes 1dc5df133b98 ("Drivers: hv: vmbus: Get the IRQ number from DeviceTree")Signed-off-by Naman Jain <[email protected]>---
Quoted 9 lines
[...]
Appreciate fixing that! From what I learned from you, x86 was broken. Very likely I did a smoke test there only while focusing on arm64. Sorry about that, thanks again!!
LGTM.
Reviewed-by Roman Kisel <[email protected]
Applied to hyperv-fixes. Thanks!