From patchwork Thu Jan 27 13:10:03 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 80683 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id A94B2B710C for ; Fri, 28 Jan 2011 00:22:59 +1100 (EST) Received: from localhost ([127.0.0.1]:39843 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PiRoN-0008KB-Do for incoming@patchwork.ozlabs.org; Thu, 27 Jan 2011 08:22:55 -0500 Received: from [140.186.70.92] (port=49386 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PiRc9-0001SA-ME for qemu-devel@nongnu.org; Thu, 27 Jan 2011 08:10:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PiRc7-0000lC-3R for qemu-devel@nongnu.org; Thu, 27 Jan 2011 08:10:17 -0500 Received: from david.siemens.de ([192.35.17.14]:19686) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PiRc6-0000iy-8E for qemu-devel@nongnu.org; Thu, 27 Jan 2011 08:10:14 -0500 Received: from mail1.siemens.de (localhost [127.0.0.1]) by david.siemens.de (8.12.11.20060308/8.12.11) with ESMTP id p0RDACQ8029873; Thu, 27 Jan 2011 14:10:12 +0100 Received: from mchn199C.mchp.siemens.de ([139.25.109.49]) by mail1.siemens.de (8.13.6/8.13.6) with ESMTP id p0RDA735009974; Thu, 27 Jan 2011 14:10:11 +0100 From: Jan Kiszka To: Avi Kivity , Marcelo Tosatti Date: Thu, 27 Jan 2011 14:10:03 +0100 Message-Id: <7e8fe53bde0b1b1e6bdf5e02159eb9629ca73be9.1296133797.git.jan.kiszka@siemens.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: References: In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org Subject: [Qemu-devel] [PATCH 19/22] kvm: Remove static return code of kvm_handle_io X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Improve the readability of the exit dispatcher by moving the static return value of kvm_handle_io to its caller. Signed-off-by: Jan Kiszka --- kvm-all.c | 17 ++++++++--------- 1 files changed, 8 insertions(+), 9 deletions(-) diff --git a/kvm-all.c b/kvm-all.c index d961697..cf54256 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -770,8 +770,8 @@ err: return ret; } -static int kvm_handle_io(uint16_t port, void *data, int direction, int size, - uint32_t count) +static void kvm_handle_io(uint16_t port, void *data, int direction, int size, + uint32_t count) { int i; uint8_t *ptr = data; @@ -805,8 +805,6 @@ static int kvm_handle_io(uint16_t port, void *data, int direction, int size, ptr += size; } - - return 1; } #ifdef KVM_CAP_INTERNAL_ERROR_DATA @@ -940,11 +938,12 @@ int kvm_cpu_exec(CPUState *env) switch (run->exit_reason) { case KVM_EXIT_IO: DPRINTF("handle_io\n"); - ret = kvm_handle_io(run->io.port, - (uint8_t *)run + run->io.data_offset, - run->io.direction, - run->io.size, - run->io.count); + kvm_handle_io(run->io.port, + (uint8_t *)run + run->io.data_offset, + run->io.direction, + run->io.size, + run->io.count); + ret = 1; break; case KVM_EXIT_MMIO: DPRINTF("handle_mmio\n");