[RFC PATCH v7 02/37] KVM: lapic: Remove redundant parentheses around 'bitmap'

Neeraj Upadhyay posted 37 patches 4 months ago
There is a newer version of this series
[RFC PATCH v7 02/37] KVM: lapic: Remove redundant parentheses around 'bitmap'
Posted by Neeraj Upadhyay 4 months ago
When doing pointer arithmetic in apic_test_vector() and
kvm_lapic_{set|clear}_vector(), remove the unnecessary
parentheses surrounding the 'bitmap' parameter.

No functional change intended.

Signed-off-by: Neeraj Upadhyay <Neeraj.Upadhyay@amd.com>
---
Changes since v6:

 - Refactored and moved to the start of the series.

 arch/x86/kvm/lapic.c | 2 +-
 arch/x86/kvm/lapic.h | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
index 11e57f351ce5..aa645b5cf013 100644
--- a/arch/x86/kvm/lapic.c
+++ b/arch/x86/kvm/lapic.c
@@ -114,7 +114,7 @@ static __always_inline void kvm_lapic_set_reg64(struct kvm_lapic *apic,
 
 static inline int apic_test_vector(int vec, void *bitmap)
 {
-	return test_bit(VEC_POS(vec), (bitmap) + REG_POS(vec));
+	return test_bit(VEC_POS(vec), bitmap + REG_POS(vec));
 }
 
 bool kvm_apic_pending_eoi(struct kvm_vcpu *vcpu, int vector)
diff --git a/arch/x86/kvm/lapic.h b/arch/x86/kvm/lapic.h
index 4ce30db65828..1638a3da383a 100644
--- a/arch/x86/kvm/lapic.h
+++ b/arch/x86/kvm/lapic.h
@@ -150,12 +150,12 @@ u64 kvm_lapic_readable_reg_mask(struct kvm_lapic *apic);
 
 static inline void kvm_lapic_clear_vector(int vec, void *bitmap)
 {
-	clear_bit(VEC_POS(vec), (bitmap) + REG_POS(vec));
+	clear_bit(VEC_POS(vec), bitmap + REG_POS(vec));
 }
 
 static inline void kvm_lapic_set_vector(int vec, void *bitmap)
 {
-	set_bit(VEC_POS(vec), (bitmap) + REG_POS(vec));
+	set_bit(VEC_POS(vec), bitmap + REG_POS(vec));
 }
 
 static inline void kvm_lapic_set_irr(int vec, struct kvm_lapic *apic)
-- 
2.34.1
Re: [RFC PATCH v7 02/37] KVM: lapic: Remove redundant parentheses around 'bitmap'
Posted by Borislav Petkov 3 months, 2 weeks ago
On Tue, Jun 10, 2025 at 11:23:49PM +0530, Neeraj Upadhyay wrote:
> When doing pointer arithmetic in apic_test_vector() and
> kvm_lapic_{set|clear}_vector(), remove the unnecessary
> parentheses surrounding the 'bitmap' parameter.
> 
> No functional change intended.
> 
> Signed-off-by: Neeraj Upadhyay <Neeraj.Upadhyay@amd.com>
> ---
> Changes since v6:
> 
>  - Refactored and moved to the start of the series.
> 
>  arch/x86/kvm/lapic.c | 2 +-
>  arch/x86/kvm/lapic.h | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)

Reviewed-by: Borislav Petkov (AMD) <bp@alien8.de>

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette
Re: [RFC PATCH v7 02/37] KVM: lapic: Remove redundant parentheses around 'bitmap'
Posted by Neeraj Upadhyay 3 months, 2 weeks ago

On 6/23/2025 5:11 PM, Borislav Petkov wrote:
> On Tue, Jun 10, 2025 at 11:23:49PM +0530, Neeraj Upadhyay wrote:
>> When doing pointer arithmetic in apic_test_vector() and
>> kvm_lapic_{set|clear}_vector(), remove the unnecessary
>> parentheses surrounding the 'bitmap' parameter.
>>
>> No functional change intended.
>>
>> Signed-off-by: Neeraj Upadhyay <Neeraj.Upadhyay@amd.com>
>> ---
>> Changes since v6:
>>
>>  - Refactored and moved to the start of the series.
>>
>>  arch/x86/kvm/lapic.c | 2 +-
>>  arch/x86/kvm/lapic.h | 4 ++--
>>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> Reviewed-by: Borislav Petkov (AMD) <bp@alien8.de>
> 

Thanks!


- Neeraj