From patchwork Thu Jan 14 17:05:58 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roel Kluin X-Patchwork-Id: 72900 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id o0EH1u3E031186 for ; Thu, 14 Jan 2010 17:01:56 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757326Ab0ANRBx (ORCPT ); Thu, 14 Jan 2010 12:01:53 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757102Ab0ANRBw (ORCPT ); Thu, 14 Jan 2010 12:01:52 -0500 Received: from mail-ew0-f209.google.com ([209.85.219.209]:42661 "EHLO mail-ew0-f209.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756851Ab0ANRBv (ORCPT ); Thu, 14 Jan 2010 12:01:51 -0500 Received: by ewy1 with SMTP id 1so43871ewy.28 for ; Thu, 14 Jan 2010 09:01:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:cc:subject:content-type :content-transfer-encoding; bh=NFaCJ4xYSMIFkzPH/P8L5xET4fOvGtD3Axum1MSihT4=; b=xNi9Q/FALednDAEQ7s9GWueHIv2wkiLMdo8saXbkya7pZca1n5CyK3eheBY8tYIaF6 mKwWZmA73ilUxleCEbCBpj8ELkSNzaKH+jYCuE3jwMr3WWpZQKCjtinurnp8mwH/km1f Zdnb5EPR4CFs5DHbsI7bKfDnJZsTheLb5NKKI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding; b=u3NenAfKaqzQymNRNnDHq/cDnYpkYTALN46D7qEvP5V3JZ/sTUGtPSG4//z++YLhka 3Q3TJqib0nao/zUzkhlQ3hjGetulcoKeYRtZwZGwgKw9TBKYea6T7tID+jXyt8nNQ5Ke ZUL21zSQWPLjp5kJUOoAb6jJrL1wbyJqYyujY= Received: by 10.213.43.83 with SMTP id v19mr989598ebe.95.1263488490001; Thu, 14 Jan 2010 09:01:30 -0800 (PST) Received: from zoinx.mars (d133062.upc-d.chello.nl [213.46.133.62]) by mx.google.com with ESMTPS id 13sm676006ewy.1.2010.01.14.09.01.28 (version=SSLv3 cipher=RC4-MD5); Thu, 14 Jan 2010 09:01:28 -0800 (PST) Message-ID: <4B4F4EF6.2050202@gmail.com> Date: Thu, 14 Jan 2010 18:05:58 +0100 From: Roel Kluin User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.5) Gecko/20091209 Fedora/3.0-4.fc12 Thunderbird/3.0 MIME-Version: 1.0 To: Xiantao Zhang , kvm-ia64@vger.kernel.org, Andrew Morton , LKML CC: Avi Kivity , kvm@vger.kernel.org Subject: [PATCH] KVM: remove redundant NULL tests Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org diff --git a/arch/ia64/kvm/kvm_fw.c b/arch/ia64/kvm/kvm_fw.c index e4b8231..cb548ee 100644 --- a/arch/ia64/kvm/kvm_fw.c +++ b/arch/ia64/kvm/kvm_fw.c @@ -75,7 +75,7 @@ static void set_pal_result(struct kvm_vcpu *vcpu, struct exit_ctl_data *p; p = kvm_get_exit_data(vcpu); - if (p && p->exit_reason == EXIT_REASON_PAL_CALL) { + if (p->exit_reason == EXIT_REASON_PAL_CALL) { p->u.pal_data.ret = result; return ; } @@ -87,7 +87,7 @@ static void set_sal_result(struct kvm_vcpu *vcpu, struct exit_ctl_data *p; p = kvm_get_exit_data(vcpu); - if (p && p->exit_reason == EXIT_REASON_SAL_CALL) { + if (p->exit_reason == EXIT_REASON_SAL_CALL) { p->u.sal_data.ret = result; return ; } @@ -322,7 +322,7 @@ static u64 kvm_get_pal_call_index(struct kvm_vcpu *vcpu) struct exit_ctl_data *p; p = kvm_get_exit_data(vcpu); - if (p && (p->exit_reason == EXIT_REASON_PAL_CALL)) + if (p->exit_reason == EXIT_REASON_PAL_CALL) index = p->u.pal_data.gr28; return index; @@ -646,18 +646,16 @@ static void kvm_get_sal_call_data(struct kvm_vcpu *vcpu, u64 *in0, u64 *in1, p = kvm_get_exit_data(vcpu); - if (p) { - if (p->exit_reason == EXIT_REASON_SAL_CALL) { - *in0 = p->u.sal_data.in0; - *in1 = p->u.sal_data.in1; - *in2 = p->u.sal_data.in2; - *in3 = p->u.sal_data.in3; - *in4 = p->u.sal_data.in4; - *in5 = p->u.sal_data.in5; - *in6 = p->u.sal_data.in6; - *in7 = p->u.sal_data.in7; - return ; - } + if (p->exit_reason == EXIT_REASON_SAL_CALL) { + *in0 = p->u.sal_data.in0; + *in1 = p->u.sal_data.in1; + *in2 = p->u.sal_data.in2; + *in3 = p->u.sal_data.in3; + *in4 = p->u.sal_data.in4; + *in5 = p->u.sal_data.in5; + *in6 = p->u.sal_data.in6; + *in7 = p->u.sal_data.in7; + return ; } *in0 = 0; }