[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <877e3wgfn2.fsf@vitty.brq.redhat.com>
Date: Tue, 19 Nov 2019 14:27:45 +0100
From: Vitaly Kuznetsov <vkuznets@...hat.com>
To: maowenan <maowenan@...wei.com>
Cc: kvm@...r.kernel.org, linux-kernel@...r.kernel.org,
kernel-janitors@...r.kernel.org, pbonzini@...hat.com,
rkrcmar@...hat.com, sean.j.christopherson@...el.com,
wanpengli@...cent.com, jmattson@...gle.com, joro@...tes.org,
tglx@...utronix.de, mingo@...hat.com, bp@...en8.de, hpa@...or.com
Subject: Re: [PATCH -next] KVM: x86: remove set but not used variable 'called'
maowenan <maowenan@...wei.com> writes:
> 在 2019/11/19 19:58, Vitaly Kuznetsov 写道:
>> Mao Wenan <maowenan@...wei.com> writes:
>>
>>> Fixes gcc '-Wunused-but-set-variable' warning:
>>>
>>> arch/x86/kvm/x86.c: In function kvm_make_scan_ioapic_request_mask:
>>> arch/x86/kvm/x86.c:7911:7: warning: variable called set but not
>>> used [-Wunused-but-set-variable]
>>>
>>> It is not used since commit 7ee30bc132c6 ("KVM: x86: deliver KVM
>>> IOAPIC scan request to target vCPUs")
>>
>> Better expressed as
>>
>> Fixes: 7ee30bc132c6 ("KVM: x86: deliver KVM IOAPIC scan request to target vCPUs")
>
> This is just a cleanup, so Fixes tag is no need.
>>
Just a cleanup -- unless we compile with '-Werror'.
>>>
>>> Signed-off-by: Mao Wenan <maowenan@...wei.com>
>>> ---
>>> arch/x86/kvm/x86.c | 5 ++---
>>> 1 file changed, 2 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
>>> index 0d0a682..870f0bc 100644
>>> --- a/arch/x86/kvm/x86.c
>>> +++ b/arch/x86/kvm/x86.c
>>> @@ -7908,12 +7908,11 @@ void kvm_make_scan_ioapic_request_mask(struct kvm *kvm,
>>> unsigned long *vcpu_bitmap)
>>> {
>>> cpumask_var_t cpus;
>>> - bool called;
>>>
>>> zalloc_cpumask_var(&cpus, GFP_ATOMIC);
>>>
>>> - called = kvm_make_vcpus_request_mask(kvm, KVM_REQ_SCAN_IOAPIC,
>>> - vcpu_bitmap, cpus);
>>> + kvm_make_vcpus_request_mask(kvm, KVM_REQ_SCAN_IOAPIC,
>>> + vcpu_bitmap, cpus);
>>
>> IMHO as kvm_make_vcpus_request_mask() returns value it would probably
>> make sense to explicitly show that we're not interested in the result,
>>
>> (void)kvm_make_vcpus_request_mask()
>
> thanks, but I think is no need to add (void) before kvm_make_vcpus_request_mask()
> because we are not interested in it's return value.
Hm, that's exactly the reason why I suggested adding it there :-) Not a
big deal, feel free to ignore.
--
Vitaly
Powered by blists - more mailing lists