* [PATCH] KVM: mmu: Remove unused local variable
@ 2010-06-03 7:08 Jan Kiszka
2010-06-03 7:23 ` Xiao Guangrong
2010-06-06 13:20 ` [PATCH] KVM: mmu: Remove unused local variable Avi Kivity
0 siblings, 2 replies; 6+ messages in thread
From: Jan Kiszka @ 2010-06-03 7:08 UTC (permalink / raw)
To: Avi Kivity, Marcelo Tosatti; +Cc: kvm
[-- Attachment #1: Type: text/plain, Size: 614 bytes --]
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;
/* Touch the page, so send SIGBUS */
hva = (void __user *)gfn_to_hva(kvm, gfn);
--
1.6.0.2
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 257 bytes --]
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] KVM: mmu: Remove unused local variable
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
2010-06-04 14:02 ` [PATCH resend] KVM: MMU: fix compile warning in kvm_send_hwpoison_signal() Xiao Guangrong
2010-06-06 13:20 ` [PATCH] KVM: mmu: Remove unused local variable Avi Kivity
1 sibling, 2 replies; 6+ messages in thread
From: Xiao Guangrong @ 2010-06-03 7:23 UTC (permalink / raw)
To: Jan Kiszka; +Cc: Avi Kivity, Marcelo Tosatti, kvm
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
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)
--
1.6.1.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] KVM: mmu: Remove unused local variable
2010-06-03 7:23 ` Xiao Guangrong
@ 2010-06-03 8:34 ` Jan Kiszka
2010-06-04 14:02 ` [PATCH resend] KVM: MMU: fix compile warning in kvm_send_hwpoison_signal() Xiao Guangrong
1 sibling, 0 replies; 6+ messages in thread
From: Jan Kiszka @ 2010-06-03 8:34 UTC (permalink / raw)
To: Xiao Guangrong; +Cc: Avi Kivity, Marcelo Tosatti, kvm, Huang Ying
[-- 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 --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH resend] KVM: MMU: fix compile warning in kvm_send_hwpoison_signal()
2010-06-03 7:23 ` Xiao Guangrong
2010-06-03 8:34 ` Jan Kiszka
@ 2010-06-04 14:02 ` Xiao Guangrong
2010-06-04 17:08 ` Marcelo Tosatti
1 sibling, 1 reply; 6+ messages in thread
From: Xiao Guangrong @ 2010-06-04 14:02 UTC (permalink / raw)
To: Avi Kivity; +Cc: Jan Kiszka, Marcelo Tosatti, kvm
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 attribute warn_unused_resul
Reported-by: Jan Kiszka <jan.kiszka@web.de>
Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
---
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)
--
1.6.1.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH resend] KVM: MMU: fix compile warning in kvm_send_hwpoison_signal()
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
0 siblings, 0 replies; 6+ messages in thread
From: Marcelo Tosatti @ 2010-06-04 17:08 UTC (permalink / raw)
To: Xiao Guangrong; +Cc: Avi Kivity, Jan Kiszka, kvm
On Fri, Jun 04, 2010 at 10:02:35PM +0800, Xiao Guangrong wrote:
> 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 attribute warn_unused_resul
>
> Reported-by: Jan Kiszka <jan.kiszka@web.de>
> Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
> ---
> arch/x86/kvm/mmu.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
Applied, thanks.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] KVM: mmu: Remove unused local variable
2010-06-03 7:08 [PATCH] KVM: mmu: Remove unused local variable Jan Kiszka
2010-06-03 7:23 ` Xiao Guangrong
@ 2010-06-06 13:20 ` Avi Kivity
1 sibling, 0 replies; 6+ messages in thread
From: Avi Kivity @ 2010-06-06 13:20 UTC (permalink / raw)
To: Jan Kiszka; +Cc: Marcelo Tosatti, kvm
On 06/03/2010 10:08 AM, 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?
>
>
My fault, sorry, I updated the patch in place to remove a dangling "r =
something;" and introduced two new warnings.
--
error compiling committee.c: too many arguments to function
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2010-06-06 13:20 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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
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.