aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorChen Gang <gang.chen@asianux.com>2013-07-22 02:32:35 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2013-08-09 04:06:51 -0400
commit2fb10672c828f6e08f1dbe3690167300035adddc (patch)
tree08102cb01f04e47aefc07aefbe94cb986f63e57b /arch
parent144136dd7a25a0ca4d86685f872168502f91f337 (diff)
powerpc/kvm: Add signed type cast for comparation
'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@asianux.com> Acked-by: Paul Mackerras <paulus@samba.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/kvm/book3s_hv.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c
index 2efa9dde741a..7629cd3eb91a 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)
1809 rma_size <<= PAGE_SHIFT; 1809 rma_size <<= PAGE_SHIFT;
1810 rmls = lpcr_rmls(rma_size); 1810 rmls = lpcr_rmls(rma_size);
1811 err = -EINVAL; 1811 err = -EINVAL;
1812 if (rmls < 0) { 1812 if ((long)rmls < 0) {
1813 pr_err("KVM: Can't use RMA of 0x%lx bytes\n", rma_size); 1813 pr_err("KVM: Can't use RMA of 0x%lx bytes\n", rma_size);
1814 goto out_srcu; 1814 goto out_srcu;
1815 } 1815 }
@@ -1874,7 +1874,7 @@ int kvmppc_core_init_vm(struct kvm *kvm)
1874 /* Allocate the guest's logical partition ID */ 1874 /* Allocate the guest's logical partition ID */
1875 1875
1876 lpid = kvmppc_alloc_lpid(); 1876 lpid = kvmppc_alloc_lpid();
1877 if (lpid < 0) 1877 if ((long)lpid < 0)
1878 return -ENOMEM; 1878 return -ENOMEM;
1879 kvm->arch.lpid = lpid; 1879 kvm->arch.lpid = lpid;
1880 1880