From: Sean Christopherson <sean.j.christopherson@intel.com>
To: Hariprasad Kelam <hariprasad.kelam@gmail.com>
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
"Radim Krčmář" <rkrcmar@redhat.com>,
"Thomas Gleixner" <tglx@linutronix.de>,
"Ingo Molnar" <mingo@redhat.com>,
"Borislav Petkov" <bp@alien8.de>,
"H. Peter Anvin" <hpa@zytor.com>,
x86@kernel.org, kvm@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] KVM: x86: fix warning Using plain integer as NULL pointer
Date: Mon, 8 Apr 2019 09:55:51 -0700 [thread overview]
Message-ID: <20190408165551.GD25880@linux.intel.com> (raw)
In-Reply-To: <20190406093658.GA7438@hari-Inspiron-1545>
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
>
prev parent reply other threads:[~2019-04-08 16:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
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 message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190408165551.GD25880@linux.intel.com \
--to=sean.j.christopherson@intel.com \
--cc=bp@alien8.de \
--cc=hariprasad.kelam@gmail.com \
--cc=hpa@zytor.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=pbonzini@redhat.com \
--cc=rkrcmar@redhat.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).