From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Hildenbrand Subject: [PATCH v3 09/24] KVM: x86: remove duplicate checks for ioapic Date: Fri, 7 Apr 2017 10:50:26 +0200 Message-ID: <20170407085041.5257-10-david@redhat.com> References: <20170407085041.5257-1-david@redhat.com> Cc: Paolo Bonzini , rkrcmar@redhat.com, Peter Xu , david@redhat.com To: kvm@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:47892 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756052AbdDGIvH (ORCPT ); Fri, 7 Apr 2017 04:51:07 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5B01F2E606E for ; Fri, 7 Apr 2017 08:51:07 +0000 (UTC) In-Reply-To: <20170407085041.5257-1-david@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: When handling KVM_GET_IRQCHIP, we already check irqchip_kernel(), which implies a fully inititalized ioapic. Signed-off-by: David Hildenbrand --- arch/x86/kvm/ioapic.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/arch/x86/kvm/ioapic.c b/arch/x86/kvm/ioapic.c index da66650..f8e988a 100644 --- a/arch/x86/kvm/ioapic.c +++ b/arch/x86/kvm/ioapic.c @@ -645,8 +645,6 @@ void kvm_ioapic_destroy(struct kvm *kvm) int kvm_get_ioapic(struct kvm *kvm, struct kvm_ioapic_state *state) { struct kvm_ioapic *ioapic = kvm->arch.vioapic; - if (!ioapic) - return -EINVAL; spin_lock(&ioapic->lock); memcpy(state, ioapic, sizeof(struct kvm_ioapic_state)); @@ -658,8 +656,6 @@ int kvm_get_ioapic(struct kvm *kvm, struct kvm_ioapic_state *state) int kvm_set_ioapic(struct kvm *kvm, struct kvm_ioapic_state *state) { struct kvm_ioapic *ioapic = kvm->arch.vioapic; - if (!ioapic) - return -EINVAL; spin_lock(&ioapic->lock); memcpy(ioapic, state, sizeof(struct kvm_ioapic_state)); -- 2.9.3