From: Vitaly Kuznetsov <vkuznets@redhat.com>
To: Colin King <colin.king@canonical.com>
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org,
Paolo Bonzini <pbonzini@redhat.com>,
Sean Christopherson <sean.j.christopherson@intel.com>,
Wanpeng Li <wanpengli@tencent.com>,
Jim Mattson <jmattson@google.com>, Joerg Roedel <joro@8bytes.org>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
x86@kernel.org, "H . Peter Anvin" <hpa@zytor.com>,
kvm@vger.kernel.org
Subject: Re: [PATCH] kvm: i8254: remove redundant assignment to pointer s
Date: Wed, 10 Jun 2020 08:32:55 +0000 [thread overview]
Message-ID: <875zbzb9s8.fsf@vitty.brq.redhat.com> (raw)
In-Reply-To: <20200609233121.1118683-1-colin.king@canonical.com>
Colin King <colin.king@canonical.com> writes:
> From: Colin Ian King <colin.king@canonical.com>
>
> The pointer s is being assigned a value that is never read, the
> assignment is redundant and can be removed.
>
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
It seems it wasn't used since the very beginning,
Fixes: 7837699fa6d7 ("KVM: In kernel PIT model")
QEMU code (from where KVM's implementation originates), however,
does make use of 's' here as it open codes pit_latch_status().
> ---
> arch/x86/kvm/i8254.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/arch/x86/kvm/i8254.c b/arch/x86/kvm/i8254.c
> index febca334c320..a6e218c6140d 100644
> --- a/arch/x86/kvm/i8254.c
> +++ b/arch/x86/kvm/i8254.c
> @@ -462,7 +462,6 @@ static int pit_ioport_write(struct kvm_vcpu *vcpu,
> if (channel = 3) {
> /* Read-Back Command. */
> for (channel = 0; channel < 3; channel++) {
> - s = &pit_state->channels[channel];
> if (val & (2 << channel)) {
> if (!(val & 0x20))
> pit_latch_count(pit, channel);
Reviewed-by: Vitaly Kuznetsov <vkuznets@redhat.com>
--
Vitaly
WARNING: multiple messages have this Message-ID (diff)
From: Vitaly Kuznetsov <vkuznets@redhat.com>
To: Colin King <colin.king@canonical.com>
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org,
Paolo Bonzini <pbonzini@redhat.com>,
Sean Christopherson <sean.j.christopherson@intel.com>,
Wanpeng Li <wanpengli@tencent.com>,
Jim Mattson <jmattson@google.com>, Joerg Roedel <joro@8bytes.org>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
x86@kernel.org, "H . Peter Anvin" <hpa@zytor.com>,
kvm@vger.kernel.org
Subject: Re: [PATCH] kvm: i8254: remove redundant assignment to pointer s
Date: Wed, 10 Jun 2020 10:32:55 +0200 [thread overview]
Message-ID: <875zbzb9s8.fsf@vitty.brq.redhat.com> (raw)
In-Reply-To: <20200609233121.1118683-1-colin.king@canonical.com>
Colin King <colin.king@canonical.com> writes:
> From: Colin Ian King <colin.king@canonical.com>
>
> The pointer s is being assigned a value that is never read, the
> assignment is redundant and can be removed.
>
> Addresses-Coverity: ("Unused value")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
It seems it wasn't used since the very beginning,
Fixes: 7837699fa6d7 ("KVM: In kernel PIT model")
QEMU code (from where KVM's implementation originates), however,
does make use of 's' here as it open codes pit_latch_status().
> ---
> arch/x86/kvm/i8254.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/arch/x86/kvm/i8254.c b/arch/x86/kvm/i8254.c
> index febca334c320..a6e218c6140d 100644
> --- a/arch/x86/kvm/i8254.c
> +++ b/arch/x86/kvm/i8254.c
> @@ -462,7 +462,6 @@ static int pit_ioport_write(struct kvm_vcpu *vcpu,
> if (channel == 3) {
> /* Read-Back Command. */
> for (channel = 0; channel < 3; channel++) {
> - s = &pit_state->channels[channel];
> if (val & (2 << channel)) {
> if (!(val & 0x20))
> pit_latch_count(pit, channel);
Reviewed-by: Vitaly Kuznetsov <vkuznets@redhat.com>
--
Vitaly
next prev parent reply other threads:[~2020-06-10 8:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-09 23:31 [PATCH] kvm: i8254: remove redundant assignment to pointer s Colin King
2020-06-09 23:31 ` Colin King
2020-06-10 8:32 ` Vitaly Kuznetsov [this message]
2020-06-10 8:32 ` Vitaly Kuznetsov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=875zbzb9s8.fsf@vitty.brq.redhat.com \
--to=vkuznets@redhat.com \
--cc=bp@alien8.de \
--cc=colin.king@canonical.com \
--cc=hpa@zytor.com \
--cc=jmattson@google.com \
--cc=joro@8bytes.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=pbonzini@redhat.com \
--cc=sean.j.christopherson@intel.com \
--cc=tglx@linutronix.de \
--cc=wanpengli@tencent.com \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.