* [PATCH] KVM: x86: fix warning Using plain integer as NULL pointer
@ 2019-04-06 9:36 Hariprasad Kelam
2019-04-06 19:17 ` Mukesh Ojha
2019-04-08 16:55 ` Sean Christopherson
0 siblings, 2 replies; 3+ messages in thread
From: Hariprasad Kelam @ 2019-04-06 9:36 UTC (permalink / raw)
To: Paolo Bonzini, Radim Krčmář,
Thomas Gleixner, Ingo Molnar, Borislav Petkov, H. Peter Anvin,
x86, kvm, linux-kernel
Changed passing argument as "0 to NULL" which resolves below sparse warning
arch/x86/kvm/x86.c:3096:61: warning: Using plain integer as NULL pointer
Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
---
arch/x86/kvm/x86.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 099b851..39034ec 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -3093,7 +3093,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
break;
case KVM_CAP_NESTED_STATE:
r = kvm_x86_ops->get_nested_state ?
- kvm_x86_ops->get_nested_state(NULL, 0, 0) : 0;
+ kvm_x86_ops->get_nested_state(NULL, NULL, 0) : 0;
break;
default:
break;
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] KVM: x86: fix warning Using plain integer as NULL pointer
2019-04-06 9:36 [PATCH] KVM: x86: fix warning Using plain integer as NULL pointer Hariprasad Kelam
@ 2019-04-06 19:17 ` Mukesh Ojha
2019-04-08 16:55 ` Sean Christopherson
1 sibling, 0 replies; 3+ messages in thread
From: Mukesh Ojha @ 2019-04-06 19:17 UTC (permalink / raw)
To: Hariprasad Kelam, Paolo Bonzini, Radim Krčmář,
Thomas Gleixner, Ingo Molnar, Borislav Petkov, H. Peter Anvin,
x86, kvm, linux-kernel
On 4/6/2019 3:06 PM, Hariprasad Kelam wrote:
> Changed passing argument as "0 to NULL" which resolves below sparse warning
>
> arch/x86/kvm/x86.c:3096:61: warning: Using plain integer as NULL pointer
>
> Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
Reviewed-by: Mukesh Ojha <mojha@codeaurora.org>
Cheers,
-Mukesh
> ---
> arch/x86/kvm/x86.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> index 099b851..39034ec 100644
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -3093,7 +3093,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
> break;
> case KVM_CAP_NESTED_STATE:
> r = kvm_x86_ops->get_nested_state ?
> - kvm_x86_ops->get_nested_state(NULL, 0, 0) : 0;
> + kvm_x86_ops->get_nested_state(NULL, NULL, 0) : 0;
> break;
> default:
> break;
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] KVM: x86: fix warning Using plain integer as NULL pointer
2019-04-06 9:36 [PATCH] KVM: x86: fix warning Using plain integer as NULL pointer Hariprasad Kelam
2019-04-06 19:17 ` Mukesh Ojha
@ 2019-04-08 16:55 ` Sean Christopherson
1 sibling, 0 replies; 3+ messages in thread
From: Sean Christopherson @ 2019-04-08 16:55 UTC (permalink / raw)
To: Hariprasad Kelam
Cc: Paolo Bonzini, Radim Krčmář,
Thomas Gleixner, Ingo Molnar, Borislav Petkov, H. Peter Anvin,
x86, kvm, linux-kernel
Nit: For future reference, wrapping the warning text with quotes in the
shortlog would be helpful. I initially read it as "fix a warning by
using a plain integer as a NULL pointer". E.g.:
KVM: x86: fix warning "Using plain integer as NULL pointer"
On Sat, Apr 06, 2019 at 03:06:58PM +0530, Hariprasad Kelam wrote:
> Changed passing argument as "0 to NULL" which resolves below sparse warning
Nit: Use imperative mood to state what the patch does, as opposed to
talking about the change in the past tense. That allows using past
tense to describe things that actually did happen in the past. E.g.:
Pass "NULL" instead of "0" for a pointer argument when querying
KVM_CAP_NESTED_STATE to resolve the below sparse warning:
>
> arch/x86/kvm/x86.c:3096:61: warning: Using plain integer as NULL pointer
>
> Signed-off-by: Hariprasad Kelam <hariprasad.kelam@gmail.com>
Thanks for the fix!
Reviewed-by: Sean Christopherson <sean.j.christopherson@intel.com>
> ---
> arch/x86/kvm/x86.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> index 099b851..39034ec 100644
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -3093,7 +3093,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
> break;
> case KVM_CAP_NESTED_STATE:
> r = kvm_x86_ops->get_nested_state ?
> - kvm_x86_ops->get_nested_state(NULL, 0, 0) : 0;
> + kvm_x86_ops->get_nested_state(NULL, NULL, 0) : 0;
> break;
> default:
> break;
> --
> 2.7.4
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-04-08 16:55 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-06 9:36 [PATCH] KVM: x86: fix warning Using plain integer as NULL pointer Hariprasad Kelam
2019-04-06 19:17 ` Mukesh Ojha
2019-04-08 16:55 ` Sean Christopherson
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.