Message ID | 20210809093410.59304-6-likexu@tencent.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | KVM: x86: Clean up redundant macro definitions | expand |
On 09/08/21 11:34, Like Xu wrote: > +#undef pr_fmt > +#define pr_fmt(fmt) "SVM: " fmt > + > #include <linux/kvm_types.h> Why do you need the #undef? Paolo
On 11/8/2021 1:48 am, Paolo Bonzini wrote: > On 09/08/21 11:34, Like Xu wrote: >> +#undef pr_fmt >> +#define pr_fmt(fmt) "SVM: " fmt >> + >> #include <linux/kvm_types.h> > > Why do you need the #undef? > > Paolo > > I've seen most of the redefinition code for 'pr_fmt' like this, for example: - 3bfaf95cb1fe81872df884956c704469e68a5bee - d157aa0fb241646e8818f699653ed983e6581b11
diff --git a/arch/x86/kvm/svm/avic.c b/arch/x86/kvm/svm/avic.c index a8ad78a2faa1..8b055f9ad9fe 100644 --- a/arch/x86/kvm/svm/avic.c +++ b/arch/x86/kvm/svm/avic.c @@ -12,8 +12,6 @@ * Avi Kivity <avi@qumranet.com> */ -#define pr_fmt(fmt) "SVM: " fmt - #include <linux/kvm_types.h> #include <linux/hashtable.h> #include <linux/amd-iommu.h> diff --git a/arch/x86/kvm/svm/nested.c b/arch/x86/kvm/svm/nested.c index 57c288ba6ef0..3080776a55a5 100644 --- a/arch/x86/kvm/svm/nested.c +++ b/arch/x86/kvm/svm/nested.c @@ -12,8 +12,6 @@ * Avi Kivity <avi@qumranet.com> */ -#define pr_fmt(fmt) "SVM: " fmt - #include <linux/kvm_types.h> #include <linux/kvm_host.h> #include <linux/kernel.h> diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c index 2b6632d4c76f..4a3f8ef56daa 100644 --- a/arch/x86/kvm/svm/svm.c +++ b/arch/x86/kvm/svm/svm.c @@ -1,5 +1,3 @@ -#define pr_fmt(fmt) "SVM: " fmt - #include <linux/kvm_host.h> #include "irq.h" diff --git a/arch/x86/kvm/svm/svm.h b/arch/x86/kvm/svm/svm.h index bd0fe94c2920..76d5fe3f00dc 100644 --- a/arch/x86/kvm/svm/svm.h +++ b/arch/x86/kvm/svm/svm.h @@ -15,6 +15,9 @@ #ifndef __SVM_SVM_H #define __SVM_SVM_H +#undef pr_fmt +#define pr_fmt(fmt) "SVM: " fmt + #include <linux/kvm_types.h> #include <linux/kvm_host.h> #include <linux/bits.h>