Skip to contentSkip to conversation

x86/hyperv: Fix compiler warnings in hv_crash.c

PATCH Applied Mukesh R 3 participants 3 messages Jan 21 – Feb 4

Subsystems (3)
lore
Share & tools
lore

Mukesh R

author
#0 lore raw

PATCH 1/1 x86/hyperv: Fix compiler warnings in hv_crash.c

Fix two compiler warnings:
o smp_ops is only defined if CONFIG_SMP
o status is set but not explicitly used.

---
 arch/x86/hyperv/hv_crash.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
arch/x86/hyperv/hv_crash.c +3 -3
index c0e22921ace1..82915b22ceae 100644
@@ -279,7 +279,6 @@ static void hv_notify_prepare_hyp(void)
 static noinline __noclone void crash_nmi_callback(struct pt_regs *regs)
 {
 	struct hv_input_disable_hyp_ex *input;
-	u64 status;
 	int msecs = 1000, ccpu = smp_processor_id();
 
 	if (ccpu == 0) {
@@ -313,7 +312,7 @@ static noinline __noclone void crash_nmi_callback(struct pt_regs *regs)
 	input->rip = trampoline_pa;
 	input->arg = devirt_arg;
 
-	status = hv_do_hypercall(HVCALL_DISABLE_HYP_EX, input, NULL);
+	hv_do_hypercall(HVCALL_DISABLE_HYP_EX, input, NULL);
 
 	hv_panic_timeout_reboot();
 }
@@ -628,8 +627,9 @@ void hv_root_crash_init(void)
 	if (rc)
 		goto err_out;
 
+#ifdef CONFIG_SMP
 	smp_ops.crash_stop_other_cpus = hv_crash_stop_other_cpus;
-
+#endif
 	crash_kexec_post_notifiers = true;
 	hv_crash_enabled = true;
 	pr_info("Hyper-V: both linux and hypervisor kdump support enabled\n");
Signature · 1 line
2.51.2.vfs.0.1
Reviewed-by on v0 1/1
#1 lore raw

From: Mukesh R <[email protected]> Sent: Tuesday, January 20, 2026 6:41 PM

Quoted 46 lines

Fix two compiler warnings:
o smp_ops is only defined if CONFIG_SMP
o status is set but not explicitly used.

---
 arch/x86/hyperv/hv_crash.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
arch/x86/hyperv/hv_crash.c +1 -2
index c0e22921ace1..82915b22ceae 100644
@@ -279,7 +279,6 @@ static void hv_notify_prepare_hyp(void)
 static noinline __noclone void crash_nmi_callback(struct pt_regs *regs)
 {
 	struct hv_input_disable_hyp_ex *input;
-	u64 status;
 	int msecs = 1000, ccpu = smp_processor_id();
 
 	if (ccpu == 0) {
@@ -313,7 +312,7 @@ static noinline __noclone void crash_nmi_callback(struct
 pt_regs *regs)
 	input->rip = trampoline_pa;
 	input->arg = devirt_arg;
 
-	status = hv_do_hypercall(HVCALL_DISABLE_HYP_EX, input, NULL);
+	hv_do_hypercall(HVCALL_DISABLE_HYP_EX, input, NULL);
 
 	hv_panic_timeout_reboot();

}

arch/x86/hyperv/hv_crash.c +2 -2
@@ -628,8 +627,9 @@ void hv_root_crash_init(void)
 	if (rc)
 		goto err_out;
 
+#ifdef CONFIG_SMP
 	smp_ops.crash_stop_other_cpus = hv_crash_stop_other_cpus;
-
+#endif
 	crash_kexec_post_notifiers = true;
 	hv_crash_enabled = true;
 	pr_info("Hyper-V: both linux and hypervisor kdump support enabled\n");
--
Quoted 2 lines

2.51.2.vfs.0.1

Ingo Molnar has separately fixed the smp_ops problem in [1]. Removing the unused "status" value looks good to me, though it's probably slightly better to add (void) to hv_do_hypercall() as an explicit acknowledgement that there's a return value that's not relevant and is being ignored; i.e.,

	(void)hv_do_hypercall(HVCALL_DISABLE_HYP_EX, input, NULL);

Regardless, for the unused "status" part of this patch,

[1] https://lore.kernel.org/all/176959812223.510.4055929851272785854.tip-bot2@tip-bot2/

maintainer Applied
#2 lore raw
Quoted 55 lines · Michael Kelley

From: Mukesh R <[email protected]> Sent: Tuesday, January 20, 2026 6:41 PM

Quoted 46 lines

Fix two compiler warnings:
o smp_ops is only defined if CONFIG_SMP
o status is set but not explicitly used.

---
 arch/x86/hyperv/hv_crash.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
arch/x86/hyperv/hv_crash.c +1 -2
index c0e22921ace1..82915b22ceae 100644
@@ -279,7 +279,6 @@ static void hv_notify_prepare_hyp(void)
 static noinline __noclone void crash_nmi_callback(struct pt_regs *regs)
 {
 	struct hv_input_disable_hyp_ex *input;
-	u64 status;
 	int msecs = 1000, ccpu = smp_processor_id();
 
 	if (ccpu == 0) {
@@ -313,7 +312,7 @@ static noinline __noclone void crash_nmi_callback(struct
 pt_regs *regs)
 	input->rip = trampoline_pa;
 	input->arg = devirt_arg;
 
-	status = hv_do_hypercall(HVCALL_DISABLE_HYP_EX, input, NULL);
+	hv_do_hypercall(HVCALL_DISABLE_HYP_EX, input, NULL);
 
 	hv_panic_timeout_reboot();

}

arch/x86/hyperv/hv_crash.c +2 -2
@@ -628,8 +627,9 @@ void hv_root_crash_init(void)
 	if (rc)
 		goto err_out;
 
+#ifdef CONFIG_SMP
 	smp_ops.crash_stop_other_cpus = hv_crash_stop_other_cpus;
-
+#endif
 	crash_kexec_post_notifiers = true;
 	hv_crash_enabled = true;
 	pr_info("Hyper-V: both linux and hypervisor kdump support enabled\n");
--
Quoted 2 lines

2.51.2.vfs.0.1

Ingo Molnar has separately fixed the smp_ops problem in [1]. Removing the unused "status" value looks good to me, though it's probably slightly better to add (void) to hv_do_hypercall() as an explicit acknowledgement that there's a return value that's not relevant and is being ignored; i.e.,

Quoted 7 lines
	(void)hv_do_hypercall(HVCALL_DISABLE_HYP_EX, input, NULL);

Regardless, for the unused "status" part of this patch,

[1] https://lore.kernel.org/all/176959812223.510.4055929851272785854.tip-bot2@tip-bot2/

It's my fault. I didn't get to this earlier.

I have applied the other fix to my tree.

Thanks,
Wei