2020-11-06 08:43:59

by Alex Shi

[permalink] [raw]
Subject: [PATCH] x86/kvm: remove unused macro HV_CLOCK_SIZE

This macro is useless, and could cause gcc warning:
arch/x86/kernel/kvmclock.c:47:0: warning: macro "HV_CLOCK_SIZE" is not
used [-Wunused-macros]
Let's remove it.

Signed-off-by: Alex Shi <[email protected]>
Cc: Paolo Bonzini <[email protected]>
Cc: Sean Christopherson <[email protected]>
Cc: Vitaly Kuznetsov <[email protected]>
Cc: Wanpeng Li <[email protected]>
Cc: Jim Mattson <[email protected]>
Cc: Joerg Roedel <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: [email protected]
Cc: "H. Peter Anvin" <[email protected]>
Cc: [email protected]
Cc: [email protected]
---
arch/x86/kernel/kvmclock.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86/kernel/kvmclock.c
index 34b18f6eeb2c..aa593743acf6 100644
--- a/arch/x86/kernel/kvmclock.c
+++ b/arch/x86/kernel/kvmclock.c
@@ -44,7 +44,6 @@ static int __init parse_no_kvmclock_vsyscall(char *arg)
early_param("no-kvmclock-vsyscall", parse_no_kvmclock_vsyscall);

/* Aligned to page sizes to match whats mapped via vsyscalls to userspace */
-#define HV_CLOCK_SIZE (sizeof(struct pvclock_vsyscall_time_info) * NR_CPUS)
#define HVC_BOOT_ARRAY_SIZE \
(PAGE_SIZE / sizeof(struct pvclock_vsyscall_time_info))

--
1.8.3.1


2020-11-06 09:37:51

by Vitaly Kuznetsov

[permalink] [raw]
Subject: Re: [PATCH] x86/kvm: remove unused macro HV_CLOCK_SIZE

Alex Shi <[email protected]> writes:

> This macro is useless, and could cause gcc warning:
> arch/x86/kernel/kvmclock.c:47:0: warning: macro "HV_CLOCK_SIZE" is not
> used [-Wunused-macros]
> Let's remove it.
>
> Signed-off-by: Alex Shi <[email protected]>
> Cc: Paolo Bonzini <[email protected]>
> Cc: Sean Christopherson <[email protected]>
> Cc: Vitaly Kuznetsov <[email protected]>
> Cc: Wanpeng Li <[email protected]>
> Cc: Jim Mattson <[email protected]>
> Cc: Joerg Roedel <[email protected]>
> Cc: Thomas Gleixner <[email protected]>
> Cc: Ingo Molnar <[email protected]>
> Cc: Borislav Petkov <[email protected]>
> Cc: [email protected]
> Cc: "H. Peter Anvin" <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> ---
> arch/x86/kernel/kvmclock.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86/kernel/kvmclock.c
> index 34b18f6eeb2c..aa593743acf6 100644
> --- a/arch/x86/kernel/kvmclock.c
> +++ b/arch/x86/kernel/kvmclock.c
> @@ -44,7 +44,6 @@ static int __init parse_no_kvmclock_vsyscall(char *arg)
> early_param("no-kvmclock-vsyscall", parse_no_kvmclock_vsyscall);
>
> /* Aligned to page sizes to match whats mapped via vsyscalls to userspace */
> -#define HV_CLOCK_SIZE (sizeof(struct pvclock_vsyscall_time_info) * NR_CPUS)
> #define HVC_BOOT_ARRAY_SIZE \
> (PAGE_SIZE / sizeof(struct pvclock_vsyscall_time_info))

Fixes: 95a3d4454bb1 ("x86/kvmclock: Switch kvmclock data to a PER_CPU variable")

where the last and the only user was removed.

Reviewed-by: Vitaly Kuznetsov <[email protected]>

--
Vitaly