public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@web.de>
To: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
Cc: Avi Kivity <avi@redhat.com>,
	Marcelo Tosatti <mtosatti@redhat.com>, kvm <kvm@vger.kernel.org>,
	Huang Ying <ying.huang@intel.com>
Subject: Re: [PATCH] KVM: mmu: Remove unused local variable
Date: Thu, 03 Jun 2010 10:34:49 +0200	[thread overview]
Message-ID: <4C076929.7070601@web.de> (raw)
In-Reply-To: <4C07586B.4070709@cn.fujitsu.com>

[-- Attachment #1: Type: text/plain, Size: 1622 bytes --]

Xiao Guangrong wrote:
> 
> Jan Kiszka wrote:
>> From: Jan Kiszka <jan.kiszka@siemens.com>
>>
>> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
>> ---
>>
>> No one else checks for new build warnings?
>>
>>  arch/x86/kvm/mmu.c |    1 -
>>  1 files changed, 0 insertions(+), 1 deletions(-)
>>
>> diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
>> index c16c4ca..9b9d773 100644
>> --- a/arch/x86/kvm/mmu.c
>> +++ b/arch/x86/kvm/mmu.c
>> @@ -2045,7 +2045,6 @@ static void kvm_send_hwpoison_signal(struct kvm *kvm, gfn_t gfn)
>>  {
>>  	char buf[1];
>>  	void __user *hva;
>> -	int r;
>>  
> 
> Actually, the compiler still complain:
> 
> arch/x86/kvm/mmu.c: In function ‘kvm_send_hwpoison_signal’:
> arch/x86/kvm/mmu.c:2051: warning: ignoring return value of ‘copy_from_user’, declared with attribute warn_unused_resul

Indeed. I only looked at the log from older kernels.

> 
> Maybe we can fix it like this:
> 
> 
> ---
>  arch/x86/kvm/mmu.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c
> index c16c4ca..a62e3ba 100644
> --- a/arch/x86/kvm/mmu.c
> +++ b/arch/x86/kvm/mmu.c
> @@ -2049,7 +2049,7 @@ static void kvm_send_hwpoison_signal(struct kvm *kvm, gfn_t gfn)
>  
>  	/* Touch the page, so send SIGBUS */
>  	hva = (void __user *)gfn_to_hva(kvm, gfn);
> -	(void)copy_from_user(buf, hva, 1);
> +	r = copy_from_user(buf, hva, 1);
>  }
>  
>  static int kvm_handle_bad_page(struct kvm *kvm, gfn_t gfn, pfn_t pfn)

Probably this was the original plan (CC'ing the author).

Jan


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 257 bytes --]

  reply	other threads:[~2010-06-03  8:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-03  7:08 [PATCH] KVM: mmu: Remove unused local variable Jan Kiszka
2010-06-03  7:23 ` Xiao Guangrong
2010-06-03  8:34   ` Jan Kiszka [this message]
2010-06-04 14:02   ` [PATCH resend] KVM: MMU: fix compile warning in kvm_send_hwpoison_signal() Xiao Guangrong
2010-06-04 17:08     ` Marcelo Tosatti
2010-06-06 13:20 ` [PATCH] KVM: mmu: Remove unused local variable Avi Kivity

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=4C076929.7070601@web.de \
    --to=jan.kiszka@web.de \
    --cc=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=xiaoguangrong@cn.fujitsu.com \
    --cc=ying.huang@intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox