Re: [PATCH] arch: powerpc: kvm: add signed type cast for comparation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Maintainers:

Please help check this patch whether OK or not, when you have time.

Thanks.

On 07/22/2013 02:32 PM, Chen Gang wrote:
> 'rmls' is 'unsigned long', lpcr_rmls() will return negative number when
> failure occurs, so it need a type cast for comparing.
> 
> 'lpid' is 'unsigned long', kvmppc_alloc_lpid() return negative number
> when failure occurs, so it need a type cast for comparing.
> 
> 
> Signed-off-by: Chen Gang <gang.chen@xxxxxxxxxxx>
> ---
>  arch/powerpc/kvm/book3s_hv.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c
> index 2efa9dd..7629cd3 100644
> --- a/arch/powerpc/kvm/book3s_hv.c
> +++ b/arch/powerpc/kvm/book3s_hv.c
> @@ -1809,7 +1809,7 @@ static int kvmppc_hv_setup_htab_rma(struct kvm_vcpu *vcpu)
>  		rma_size <<= PAGE_SHIFT;
>  		rmls = lpcr_rmls(rma_size);
>  		err = -EINVAL;
> -		if (rmls < 0) {
> +		if ((long)rmls < 0) {
>  			pr_err("KVM: Can't use RMA of 0x%lx bytes\n", rma_size);
>  			goto out_srcu;
>  		}
> @@ -1874,7 +1874,7 @@ int kvmppc_core_init_vm(struct kvm *kvm)
>  	/* Allocate the guest's logical partition ID */
>  
>  	lpid = kvmppc_alloc_lpid();
> -	if (lpid < 0)
> +	if ((long)lpid < 0)
>  		return -ENOMEM;
>  	kvm->arch.lpid = lpid;
>  
> 


-- 
Chen Gang
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux