All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Mathias Krause <minipli@googlemail.com>
Cc: Gleb Natapov <gleb@redhat.com>, kvm@vger.kernel.org
Subject: Re: [PATCH 2/3] KVM: VMX: Use size_t to store sizeof() values
Date: Thu, 27 Jun 2013 15:36:19 +0200	[thread overview]
Message-ID: <51CC3FD3.9090100@redhat.com> (raw)
In-Reply-To: <1372271783-18732-3-git-send-email-minipli@googlemail.com>

Il 26/06/2013 20:36, Mathias Krause ha scritto:
> The type for storing values of the sizeof operator should be size_t.
> No semantical changes, only type correctness.
> 
> Signed-off-by: Mathias Krause <minipli@googlemail.com>
> ---
>  arch/x86/kvm/vmx.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
> index 7393164..cd9090f 100644
> --- a/arch/x86/kvm/vmx.c
> +++ b/arch/x86/kvm/vmx.c
> @@ -3909,7 +3909,7 @@ static void free_vpid(struct vcpu_vmx *vmx)
>  static void __vmx_disable_intercept_for_msr(unsigned long *msr_bitmap,
>  						u32 msr, int type)
>  {
> -	int f = sizeof(unsigned long);
> +	const size_t f = sizeof(unsigned long);
>  
>  	if (!cpu_has_vmx_msr_bitmap())
>  		return;
> @@ -3944,7 +3944,7 @@ static void __vmx_disable_intercept_for_msr(unsigned long *msr_bitmap,
>  static void __vmx_enable_intercept_for_msr(unsigned long *msr_bitmap,
>  						u32 msr, int type)
>  {
> -	int f = sizeof(unsigned long);
> +	const size_t f = sizeof(unsigned long);
>  
>  	if (!cpu_has_vmx_msr_bitmap())
>  		return;
> 

Both the "const" and the change seem like useless churn.  It is only
used to adjust a pointer by a given number of bytes.

Paolo

  reply	other threads:[~2013-06-27 13:36 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-26 18:36 [PATCH 0/3] KVM: small type cleanups Mathias Krause
2013-06-26 18:36 ` [PATCH 1/3] KVM: VMX: Use proper types to access const arrays Mathias Krause
2013-06-27 13:33   ` Paolo Bonzini
2013-06-27 13:42     ` Mathias Krause
2013-06-27 13:47       ` Paolo Bonzini
2013-06-26 18:36 ` [PATCH 2/3] KVM: VMX: Use size_t to store sizeof() values Mathias Krause
2013-06-27 13:36   ` Paolo Bonzini [this message]
2013-06-26 18:36 ` [PATCH 3/3] KVM: x86: Drop useless cast Mathias Krause
2013-06-27 13:39   ` Paolo Bonzini
2013-07-11  7:43 ` [PATCH 0/3] KVM: small type cleanups Gleb Natapov

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=51CC3FD3.9090100@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=gleb@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=minipli@googlemail.com \
    /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 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.