KVM: mmu: Remove unused local variable
PATCH 1/1 KVM: mmu: Remove unused local variable
From: Jan Kiszka <[email protected]>
---
No one else checks for new build warnings?
arch/x86/kvm/mmu.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)
arch/x86/kvm/mmu.c +0 -1
@@ -2045,7 +2045,6 @@ static void kvm_send_hwpoison_signal(struct kvm *kvm, gfn_t gfn) {char buf[1 ];void __user *hva; -int r;/* Touch the page, so send SIGBUS */ hva = (void __user *)gfn_to_hva (kvm, gfn);
Signature · 1 line
1.6.0.2
Quoted 15 lines · Jan Kiszka
From: Jan Kiszka <[email protected]>
Signed-off-by Jan Kiszka <[email protected]>---
No one else checks for new build warnings?
arch/x86/kvm/mmu.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)arch/x86/kvm/mmu.c +0
-0
arch/x86/kvm/mmu.c static void kvm_send_hwpoison_signal(struct kvm *kvm, gfn_t gfn) · line 2048
Quoted 5 lines
arch/x86/kvm/mmu.c +0
-1@@ -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
Maybe we can fix it like this:
--- arch/x86/kvm/mmu.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/x86/kvm/mmu.c +1 -1
@@ -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)
Signature · 1 line
1.6.1.2
Quoted 25 lines · Xiao Guangrong
Quoted 15 lines · Jan Kiszka
From: Jan Kiszka <[email protected]>
Signed-off-by Jan Kiszka <[email protected]>---
No one else checks for new build warnings?
arch/x86/kvm/mmu.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)arch/x86/kvm/mmu.c +0
-0arch/x86/kvm/mmu.c static void kvm_send_hwpoison_signal(struct kvm *kvm, gfn_t gfn) · line 2048
Quoted 5 lines
arch/x86/kvm/mmu.c +0
-1@@ -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:
Quoted 2 lines
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 attributewarn_unused_resul
Indeed. I only looked at the log from older kernels.
Quoted 13 lines
Maybe we can fix it like this:
--- arch/x86/kvm/mmu.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)arch/x86/kvm/mmu.c +0
-0
arch/x86/kvm/mmu.c static void kvm_send_hwpoison_signal(struct kvm *kvm, gfn_t gfn) · line 2055
Quoted 8 lines
arch/x86/kvm/mmu.c +1
-1@@ -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
PATCH RESEND 1/1 KVM: MMU: fix compile warning in kvm_send_hwpoison_signal()
In reply to Xiao Guangrongfix:
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
--- arch/x86/kvm/mmu.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/x86/kvm/mmu.c +1 -1
@@ -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)
Signature · 1 line
1.6.1.2
Marcelo Tosatti
AppliedRe: [PATCH resend] KVM: MMU: fix compile warning in kvm_send_hwpoison_signal()
Quoted 10 lines · Xiao Guangrong
fix:
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 attributewarn_unused_resulReported-by Jan Kiszka <[email protected]>Signed-off-by Xiao Guangrong <[email protected]>--- arch/x86/kvm/mmu.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
Applied, thanks.
Quoted 8 lines · Jan Kiszka
From: Jan Kiszka<[email protected]>
Signed-off-by Jan Kiszka<[email protected]>---
No one else checks for new build warnings?
My fault, sorry, I updated the patch in place to remove a dangling "r = something;" and introduced two new warnings.
Signature · 1 line
error compiling committee.c: too many arguments to function