Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1296382

[POC][PATCH 35/83] s390 kvm: get rid of pointless casts

From Al Viro <viro@ZenIV.linux.org.uk>
Newsgroups linux.kernel
Subject [POC][PATCH 35/83] s390 kvm: get rid of pointless casts
Date 2015-12-22 01:10 +0100
Message-ID <qIiGF-50N-67@gated-at.bofh.it> (permalink)
References <qIing-4Eb-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Al Viro <viro@zeniv.linux.org.uk>

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
 arch/s390/kvm/priv.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/arch/s390/kvm/priv.c b/arch/s390/kvm/priv.c
index af22195..93963ff 100644
--- a/arch/s390/kvm/priv.c
+++ b/arch/s390/kvm/priv.c
@@ -504,7 +504,7 @@ static int handle_stsi(struct kvm_vcpu *vcpu)
 	int fc = (vcpu->run->s.regs.gprs[0] & 0xf0000000) >> 28;
 	int sel1 = vcpu->run->s.regs.gprs[0] & 0xff;
 	int sel2 = vcpu->run->s.regs.gprs[1] & 0xffff;
-	unsigned long mem = 0;
+	void *mem = NULL;
 	u64 operand2;
 	int rc = 0;
 	ar_t ar;
@@ -538,23 +538,23 @@ static int handle_stsi(struct kvm_vcpu *vcpu)
 	switch (fc) {
 	case 1: /* same handling for 1 and 2 */
 	case 2:
-		mem = (unsigned long)get_zeroed_page(GFP_KERNEL);
+		mem = get_zeroed_page(GFP_KERNEL);
 		if (!mem)
 			goto out_no_data;
-		if (stsi((void *) mem, fc, sel1, sel2))
+		if (stsi(mem, fc, sel1, sel2))
 			goto out_no_data;
 		break;
 	case 3:
 		if (sel1 != 2 || sel2 != 2)
 			goto out_no_data;
-		mem = (unsigned long)get_zeroed_page(GFP_KERNEL);
+		mem = get_zeroed_page(GFP_KERNEL);
 		if (!mem)
 			goto out_no_data;
-		handle_stsi_3_2_2(vcpu, (void *) mem);
+		handle_stsi_3_2_2(vcpu, mem);
 		break;
 	}
 
-	rc = write_guest(vcpu, operand2, ar, (void *)mem, PAGE_SIZE);
+	rc = write_guest(vcpu, operand2, ar, mem, PAGE_SIZE);
 	if (rc) {
 		rc = kvm_s390_inject_prog_cond(vcpu, rc);
 		goto out;
@@ -564,14 +564,14 @@ static int handle_stsi(struct kvm_vcpu *vcpu)
 		rc = -EREMOTE;
 	}
 	trace_kvm_s390_handle_stsi(vcpu, fc, sel1, sel2, operand2);
-	free_page((void *)mem);
+	free_page(mem);
 	kvm_s390_set_psw_cc(vcpu, 0);
 	vcpu->run->s.regs.gprs[0] = 0;
 	return rc;
 out_no_data:
 	kvm_s390_set_psw_cc(vcpu, 3);
 out:
-	free_page((void *)mem);
+	free_page(mem);
 	return rc;
 }
 
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[POC][PATCH 35/83] s390 kvm: get rid of pointless casts Al Viro <viro@ZenIV.linux.org.uk> - 2015-12-22 01:10 +0100

csiph-web