From patchwork Fri Feb 4 15:47:23 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Tosatti X-Patchwork-Id: 81912 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 68E6DB7112 for ; Sat, 5 Feb 2011 03:05:35 +1100 (EST) Received: from localhost ([127.0.0.1]:51303 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PlOA8-0005KY-Qe for incoming@patchwork.ozlabs.org; Fri, 04 Feb 2011 11:05:33 -0500 Received: from [140.186.70.92] (port=51758 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PlNuw-00062i-Fb for qemu-devel@nongnu.org; Fri, 04 Feb 2011 10:49:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PlNuv-00080s-6E for qemu-devel@nongnu.org; Fri, 04 Feb 2011 10:49:50 -0500 Received: from mx1.redhat.com ([209.132.183.28]:4157) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PlNuu-00080A-VJ for qemu-devel@nongnu.org; Fri, 04 Feb 2011 10:49:49 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p14Fnl1h031933 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 4 Feb 2011 10:49:47 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p14FnlB0001052; Fri, 4 Feb 2011 10:49:47 -0500 Received: from amt.cnet (vpn2-8-97.ams2.redhat.com [10.36.8.97]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id p14FnjHC002258; Fri, 4 Feb 2011 10:49:46 -0500 Received: from amt.cnet (localhost.localdomain [127.0.0.1]) by amt.cnet (Postfix) with ESMTP id 983D065214D; Fri, 4 Feb 2011 13:48:51 -0200 (BRST) Received: (from marcelo@localhost) by amt.cnet (8.14.4/8.14.4/Submit) id p14Fmmx5017700; Fri, 4 Feb 2011 13:48:48 -0200 From: Marcelo Tosatti To: Anthony Liguori Date: Fri, 4 Feb 2011 13:47:23 -0200 Message-Id: <4935b5132c18b139ce5982af0b0c4cf496650094.1296834446.git.mtosatti@redhat.com> In-Reply-To: References: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: Jan Kiszka , Marcelo Tosatti , qemu-devel@nongnu.org, kvm@vger.kernel.org Subject: [Qemu-devel] [PATCH 20/23] 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 From: Jan Kiszka 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 Signed-off-by: Marcelo Tosatti --- kvm-all.c | 17 ++++++++--------- 1 files changed, 8 insertions(+), 9 deletions(-) diff --git a/kvm-all.c b/kvm-all.c index 0c20f9e..4729ec5 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -774,8 +774,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; @@ -809,8 +809,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 @@ -944,11 +942,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");