From patchwork Sun Mar 22 10:37:05 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gleb Natapov X-Patchwork-Id: 13560 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n2MAf9tg000457 for ; Sun, 22 Mar 2009 10:41:09 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752102AbZCVKlH (ORCPT ); Sun, 22 Mar 2009 06:41:07 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752026AbZCVKlG (ORCPT ); Sun, 22 Mar 2009 06:41:06 -0400 Received: from mx2.redhat.com ([66.187.237.31]:51364 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752014AbZCVKlD (ORCPT ); Sun, 22 Mar 2009 06:41:03 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n2MAf1Uf000416 for ; Sun, 22 Mar 2009 06:41:01 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n2MAevnZ002766; Sun, 22 Mar 2009 06:40:57 -0400 Received: from dhcp-1-237.tlv.redhat.com (dhcp-1-237.tlv.redhat.com [10.35.1.237]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n2MAf1nk006206; Sun, 22 Mar 2009 06:41:01 -0400 Received: by dhcp-1-237.tlv.redhat.com (Postfix, from userid 587) id 122A418D41C; Sun, 22 Mar 2009 12:37:05 +0200 (IST) Date: Sun, 22 Mar 2009 12:37:05 +0200 From: Gleb Natapov To: avi@redhat.com Cc: kvm@vger.kernel.org Subject: [PATCH] remove duplicate code Message-ID: <20090322103705.GB25518@redhat.com> MIME-Version: 1.0 Content-Disposition: inline X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org svm_do_inject_vector() reimplements pop_irq(). Signed-off-by: Gleb Natapov --- Gleb. -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 1821c20..da23fd3 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c @@ -2344,15 +2344,7 @@ static void kvm_reput_irq(struct vcpu_svm *svm) static void svm_do_inject_vector(struct vcpu_svm *svm) { - struct kvm_vcpu *vcpu = &svm->vcpu; - int word_index = __ffs(vcpu->arch.irq_summary); - int bit_index = __ffs(vcpu->arch.irq_pending[word_index]); - int irq = word_index * BITS_PER_LONG + bit_index; - - clear_bit(bit_index, &vcpu->arch.irq_pending[word_index]); - if (!vcpu->arch.irq_pending[word_index]) - clear_bit(word_index, &vcpu->arch.irq_summary); - svm_inject_irq(svm, irq); + svm_inject_irq(svm, pop_irq(&svm->vcpu)); } static void do_interrupt_requests(struct kvm_vcpu *vcpu,