* [PATCH v2] [x86/kvm] emulate.c: Fix comppilation warning
@ 2015-06-10 0:33 Rajat Jain
2015-06-10 1:17 ` Bandan Das
0 siblings, 1 reply; 3+ messages in thread
From: Rajat Jain @ 2015-06-10 0:33 UTC (permalink / raw)
To: Gleb Natapov, Paolo Bonzini, Thomas Gleixner, Ingo Molnar,
H. Peter Anvin, x86, kvm, linux-kernel
Cc: rajatxjain, Rajat Jain
Fix the following warning:
arch/x86/kvm/emulate.c: In function '__do_insn_fetch_bytes':
arch/x86/kvm/emulate.c:814:47: warning: 'linear' may be used uninitialized in this function [-Wmaybe-uninitialized]
arch/x86/kvm/emulate.c:793:16: note: 'linear' was declared here
Signed-off-by: Rajat Jain <rajatja@google.com>
Signed-off-by: Rajat Jain <rajatxjain@gmail.com>
---
v2: Fix the wrong email address.
arch/x86/kvm/emulate.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
index 630bcb0..f06e0ca 100644
--- a/arch/x86/kvm/emulate.c
+++ b/arch/x86/kvm/emulate.c
@@ -790,7 +790,7 @@ static int __do_insn_fetch_bytes(struct x86_emulate_ctxt *ctxt, int op_size)
{
int rc;
unsigned size, max_size;
- unsigned long linear;
+ unsigned long linear = 0;
int cur_size = ctxt->fetch.end - ctxt->fetch.data;
struct segmented_address addr = { .seg = VCPU_SREG_CS,
.ea = ctxt->eip + cur_size };
--
2.2.0.rc0.207.ga3a616c
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] [x86/kvm] emulate.c: Fix comppilation warning
2015-06-10 0:33 [PATCH v2] [x86/kvm] emulate.c: Fix comppilation warning Rajat Jain
@ 2015-06-10 1:17 ` Bandan Das
2015-06-10 17:04 ` Rajat Jain
0 siblings, 1 reply; 3+ messages in thread
From: Bandan Das @ 2015-06-10 1:17 UTC (permalink / raw)
To: Rajat Jain
Cc: Gleb Natapov, Paolo Bonzini, Thomas Gleixner, Ingo Molnar,
H. Peter Anvin, x86, kvm, linux-kernel, rajatxjain
Rajat Jain <rajatja@google.com> writes:
> Fix the following warning:
>
> arch/x86/kvm/emulate.c: In function '__do_insn_fetch_bytes':
> arch/x86/kvm/emulate.c:814:47: warning: 'linear' may be used uninitialized in this function [-Wmaybe-uninitialized]
> arch/x86/kvm/emulate.c:793:16: note: 'linear' was declared here
Is this recent gcc behavior ? If yes, please mention that in the commit
message.
Please follow convention for the subject line and fix the typo -
"KVM: emulate: Fix compilation warning"
Thanks,
Bandan
> Signed-off-by: Rajat Jain <rajatja@google.com>
> Signed-off-by: Rajat Jain <rajatxjain@gmail.com>
> ---
> v2: Fix the wrong email address.
>
> arch/x86/kvm/emulate.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
> index 630bcb0..f06e0ca 100644
> --- a/arch/x86/kvm/emulate.c
> +++ b/arch/x86/kvm/emulate.c
> @@ -790,7 +790,7 @@ static int __do_insn_fetch_bytes(struct x86_emulate_ctxt *ctxt, int op_size)
> {
> int rc;
> unsigned size, max_size;
> - unsigned long linear;
> + unsigned long linear = 0;
> int cur_size = ctxt->fetch.end - ctxt->fetch.data;
> struct segmented_address addr = { .seg = VCPU_SREG_CS,
> .ea = ctxt->eip + cur_size };
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] [x86/kvm] emulate.c: Fix comppilation warning
2015-06-10 1:17 ` Bandan Das
@ 2015-06-10 17:04 ` Rajat Jain
0 siblings, 0 replies; 3+ messages in thread
From: Rajat Jain @ 2015-06-10 17:04 UTC (permalink / raw)
To: Bandan Das
Cc: Gleb Natapov, Paolo Bonzini, Thomas Gleixner, Ingo Molnar,
H. Peter Anvin, x86, kvm, linux-kernel, Rajat Jain
Hello Bandan,
On Tue, Jun 9, 2015 at 6:17 PM, Bandan Das <bsd@redhat.com> wrote:
> Rajat Jain <rajatja@google.com> writes:
>
>> Fix the following warning:
>>
>> arch/x86/kvm/emulate.c: In function '__do_insn_fetch_bytes':
>> arch/x86/kvm/emulate.c:814:47: warning: 'linear' may be used uninitialized in this function [-Wmaybe-uninitialized]
>> arch/x86/kvm/emulate.c:793:16: note: 'linear' was declared here
>
> Is this recent gcc behavior ? If yes, please mention that in the commit
> message.
Sorry, I realized that I was using an internal version of gcc. I don't
see the warning with gcc 4.8.2 that comes with ubuntu. So I guess we
can ignore the patch then...
Thanks,
Rajat
>
> Please follow convention for the subject line and fix the typo -
> "KVM: emulate: Fix compilation warning"
>
> Thanks,
> Bandan
>
>
>> Signed-off-by: Rajat Jain <rajatja@google.com>
>> Signed-off-by: Rajat Jain <rajatxjain@gmail.com>
>> ---
>> v2: Fix the wrong email address.
>>
>> arch/x86/kvm/emulate.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c
>> index 630bcb0..f06e0ca 100644
>> --- a/arch/x86/kvm/emulate.c
>> +++ b/arch/x86/kvm/emulate.c
>> @@ -790,7 +790,7 @@ static int __do_insn_fetch_bytes(struct x86_emulate_ctxt *ctxt, int op_size)
>> {
>> int rc;
>> unsigned size, max_size;
>> - unsigned long linear;
>> + unsigned long linear = 0;
>> int cur_size = ctxt->fetch.end - ctxt->fetch.data;
>> struct segmented_address addr = { .seg = VCPU_SREG_CS,
>> .ea = ctxt->eip + cur_size };
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-06-10 17:04 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-10 0:33 [PATCH v2] [x86/kvm] emulate.c: Fix comppilation warning Rajat Jain
2015-06-10 1:17 ` Bandan Das
2015-06-10 17:04 ` Rajat Jain
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).