Skip to contentSkip to conversation

KVM: x86: Remove the second definition of pr_fmt in hyperv.c

PATCH In review Aaron Lewis 2 participants 2 messages Dec 27, 2022 – Dec 28, 2022

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 KVM: x86: Remove the second definition of pr_fmt in hyperv.c

Both commit e21d10ee00c5 ("KVM: x86: Unify pr_fmt to use module name for all KVM modules") and commit 1567037614af ("KVM: VMX: Resurrect vmcs_conf sanitization for KVM-on-Hyper-V") define pr_fmt.

Remove the pr_fmt that was defined in commit 1567037614af ("KVM: VMX:
Resurrect vmcs_conf sanitization for KVM-on-Hyper-V").

With both defined I get this:

arch/x86/kvm/vmx/hyperv.c:4:9: error: 'pr_fmt' macro redefined [-Werror,-Wmacro-redefined]

        ^
arch/x86/kvm/vmx/hyperv.c:2:9: note: previous definition is here
        ^
  UPD     arch/x86/kvm/kvm-asm-offsets.h
  AS      arch/x86/kvm/vmx/vmenter.o
  AS      arch/x86/kvm/svm/vmenter.o

1 error generated.

---
 arch/x86/kvm/vmx/hyperv.c | 2 --
 1 file changed, 2 deletions(-)
arch/x86/kvm/vmx/hyperv.c +0 -2
index 398240a4327b5..2a26a0f27d489 100644
@@ -1,8 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
-#define pr_fmt(fmt) "kvm/hyper-v: " fmt
-
 #include <linux/errno.h>
 #include <linux/smp.h>
 
Signature · 1 line
2.39.0.314.g84b9a713c41-goog
maintainer
#1 lore raw
Quoted 4 lines · Aaron Lewis

Both commit e21d10ee00c5 ("KVM: x86: Unify pr_fmt to use module name for all KVM modules") and commit 1567037614af ("KVM: VMX: Resurrect vmcs_conf sanitization for KVM-on-Hyper-V") define pr_fmt.

Quoted 8 lines

Remove the pr_fmt that was defined in commit 1567037614af ("KVM: VMX:
Resurrect vmcs_conf sanitization for KVM-on-Hyper-V").

With both defined I get this:

arch/x86/kvm/vmx/hyperv.c:4:9: error: 'pr_fmt' macro redefined [-Werror,-Wmacro-redefined]

         ^

arch/x86/kvm/vmx/hyperv.c:2:9: note: previous definition is here

Hi Aaron,

since I am not really sure how much I am going to look at KVM during the vacations (and I assumed not many people would be looking at the results...), I pushed to kvm/queue without even doing a build test.

I am using these early merges to experiment with topic branches so, if applicable, I will rewind the merges and fix the semantic conflicts in the merges where they arise, either in the merges themselves or in the commits.

Paolo