Re: [PATCH] KVM: mmu: Remove unused local variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Xiao Guangrong wrote:
> 
> Jan Kiszka wrote:
>> From: Jan Kiszka <jan.kiszka@xxxxxxxxxxx>
>>
>> Signed-off-by: Jan Kiszka <jan.kiszka@xxxxxxxxxxx>
>> ---
>>
>> 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: signature.asc
Description: OpenPGP digital signature


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux