diff options
author | Chen Gang <gang.chen@asianux.com> | 2013-07-22 02:32:35 -0400 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2013-08-28 10:23:35 -0400 |
commit | 5d226ae56f4dee608099daa599d9df0d12e3b006 (patch) | |
tree | eca64013d43452c7ac6f32f371bf1d09420e78ee /arch/powerpc/kvm | |
parent | 87916442bd0ac0aaabcca4f7fcd7eb3d8bef0d34 (diff) |
arch: 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: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'arch/powerpc/kvm')
-rw-r--r-- | 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 1cbcb4ca5800..8aadd237d453 100644 --- a/arch/powerpc/kvm/book3s_hv.c +++ b/arch/powerpc/kvm/book3s_hv.c | |||
@@ -1817,7 +1817,7 @@ static int kvmppc_hv_setup_htab_rma(struct kvm_vcpu *vcpu) | |||
1817 | rma_size <<= PAGE_SHIFT; | 1817 | rma_size <<= PAGE_SHIFT; |
1818 | rmls = lpcr_rmls(rma_size); | 1818 | rmls = lpcr_rmls(rma_size); |
1819 | err = -EINVAL; | 1819 | err = -EINVAL; |
1820 | if (rmls < 0) { | 1820 | if ((long)rmls < 0) { |
1821 | pr_err("KVM: Can't use RMA of 0x%lx bytes\n", rma_size); | 1821 | pr_err("KVM: Can't use RMA of 0x%lx bytes\n", rma_size); |
1822 | goto out_srcu; | 1822 | goto out_srcu; |
1823 | } | 1823 | } |
@@ -1882,7 +1882,7 @@ int kvmppc_core_init_vm(struct kvm *kvm) | |||
1882 | /* Allocate the guest's logical partition ID */ | 1882 | /* Allocate the guest's logical partition ID */ |
1883 | 1883 | ||
1884 | lpid = kvmppc_alloc_lpid(); | 1884 | lpid = kvmppc_alloc_lpid(); |
1885 | if (lpid < 0) | 1885 | if ((long)lpid < 0) |
1886 | return -ENOMEM; | 1886 | return -ENOMEM; |
1887 | kvm->arch.lpid = lpid; | 1887 | kvm->arch.lpid = lpid; |
1888 | 1888 | ||