From patchwork Wed Jan 16 01:07:36 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cong Ding X-Patchwork-Id: 1986241 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id E21FEDF264 for ; Wed, 16 Jan 2013 01:08:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757389Ab3APBIC (ORCPT ); Tue, 15 Jan 2013 20:08:02 -0500 Received: from mail-wg0-f50.google.com ([74.125.82.50]:37151 "EHLO mail-wg0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757356Ab3APBH7 (ORCPT ); Tue, 15 Jan 2013 20:07:59 -0500 Received: by mail-wg0-f50.google.com with SMTP id es5so518945wgb.5 for ; Tue, 15 Jan 2013 17:07:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=vBsE2DwF/kbVlFIA+nFXCeGIwt9vpeVor5Mhz9utlOY=; b=pUVUI9BfBcYnxYACMCOeWEP1hUmxSZuDcatj/Dk6D+fCGCB7lq6qXNDHVjahg6cn34 ojj1AMinUW//5vlTjxGeJPhXLcmfViMtc8QHlOR2nzwF2OTuNO6OSHvQOrngIE1PSYPn 8AYoLOeaGm1BJTFsqQw0JE5zH7U/BFU16STU//jN/ZWQQnS5/ZglS6soRJ2Ze3aeMxwK 21DEtM+QZg54GL34tYkMtulQ1G3UDOlvUPXzta8UyhI5i2IafF8RYIitUL//vSswXdAr o+VlejC3p3hJWizMbcFFPJxehwDx1+y4xZYWlWhqdSdvAO/xlZudN/VLCJbWma5O52PX 3XnA== X-Received: by 10.194.77.13 with SMTP id o13mr145064434wjw.58.1358298477853; Tue, 15 Jan 2013 17:07:57 -0800 (PST) Received: from localhost.localdomain (77.47.90.154.dynamic.cablesurf.de. [77.47.90.154]) by mx.google.com with ESMTPS id p2sm6365097wic.7.2013.01.15.17.07.56 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 15 Jan 2013 17:07:56 -0800 (PST) From: Cong Ding To: Pekka Enberg , Sasha Levin , Asias He , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Cong Ding Subject: [PATCH] kvm: remove redundant "if" condition Date: Wed, 16 Jan 2013 02:07:36 +0100 Message-Id: <1358298456-18377-2-git-send-email-dinggnu@gmail.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1358298456-18377-1-git-send-email-dinggnu@gmail.com> References: <1358298456-18377-1-git-send-email-dinggnu@gmail.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org After we check (state.kcount != 0), state.kcount has to be 0 in all the "else" branchs. Signed-off-by: Cong Ding --- tools/kvm/hw/i8042.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/kvm/hw/i8042.c b/tools/kvm/hw/i8042.c index 9f8be6a..9035732 100644 --- a/tools/kvm/hw/i8042.c +++ b/tools/kvm/hw/i8042.c @@ -189,7 +189,7 @@ static u32 kbd_read_data(void) state.mcount--; kvm__irq_line(state.kvm, AUX_IRQ, 0); kbd_update_irq(); - } else if (state.kcount == 0) { + } else { i = state.kread - 1; if (i < 0) i = QUEUE_SIZE;