From patchwork Wed Nov 5 09:03:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tiejun Chen X-Patchwork-Id: 5232981 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 464729F2F1 for ; Wed, 5 Nov 2014 09:10:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8E1C62015A for ; Wed, 5 Nov 2014 09:10:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 97C8E20145 for ; Wed, 5 Nov 2014 09:10:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754203AbaKEJKH (ORCPT ); Wed, 5 Nov 2014 04:10:07 -0500 Received: from mga11.intel.com ([192.55.52.93]:4086 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753495AbaKEJKG (ORCPT ); Wed, 5 Nov 2014 04:10:06 -0500 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 05 Nov 2014 01:09:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.07,318,1413270000"; d="scan'208";a="617425043" Received: from tchen0-linux.bj.intel.com ([10.238.135.73]) by fmsmga001.fm.intel.com with ESMTP; 05 Nov 2014 01:08:05 -0800 From: Tiejun Chen To: pbonzini@redhat.com Cc: kvm@vger.kernel.org Subject: [PATCH] kvm: x86: lapic: remove one redundant judging condition Date: Wed, 5 Nov 2014 17:03:05 +0800 Message-Id: <1415178185-11109-1-git-send-email-tiejun.chen@intel.com> X-Mailer: git-send-email 1.9.1 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Finally we always return highest_irr so its unnecessary to return -1 after check if highest_irr == -1. Signed-off-by: Tiejun Chen --- arch/x86/kvm/lapic.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c index 5f574b4..e6a7eb6 100644 --- a/arch/x86/kvm/lapic.c +++ b/arch/x86/kvm/lapic.c @@ -1638,8 +1638,7 @@ int kvm_apic_has_interrupt(struct kvm_vcpu *vcpu) apic_update_ppr(apic); highest_irr = apic_find_highest_irr(apic); - if ((highest_irr == -1) || - ((highest_irr & 0xF0) <= kvm_apic_get_reg(apic, APIC_PROCPRI))) + if ((highest_irr & 0xF0) <= kvm_apic_get_reg(apic, APIC_PROCPRI)) return -1; return highest_irr; }