From patchwork Tue Feb 1 21:16:01 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 81405 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 9CF26B710F for ; Wed, 2 Feb 2011 10:29:47 +1100 (EST) Received: from localhost ([127.0.0.1]:42963 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PkNq9-0005Pa-CA for incoming@patchwork.ozlabs.org; Tue, 01 Feb 2011 16:32:45 -0500 Received: from [140.186.70.92] (port=47074 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PkNhF-0000wz-5T for qemu-devel@nongnu.org; Tue, 01 Feb 2011 16:23:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PkNb4-0003M0-VJ for qemu-devel@nongnu.org; Tue, 01 Feb 2011 16:17:12 -0500 Received: from fmmailgate01.web.de ([217.72.192.221]:60074) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PkNb4-0003Lt-Mg for qemu-devel@nongnu.org; Tue, 01 Feb 2011 16:17:10 -0500 Received: from smtp05.web.de ( [172.20.4.166]) by fmmailgate01.web.de (Postfix) with ESMTP id AAE62186D8AB8; Tue, 1 Feb 2011 22:16:15 +0100 (CET) Received: from [88.65.41.52] (helo=localhost.localdomain) by smtp05.web.de with asmtp (TLSv1:AES256-SHA:256) (WEB.DE 4.110 #2) id 1PkNaB-0006FM-01; Tue, 01 Feb 2011 22:16:15 +0100 From: Jan Kiszka To: Avi Kivity , Marcelo Tosatti Date: Tue, 1 Feb 2011 22:16:01 +0100 Message-Id: X-Mailer: git-send-email 1.7.1 In-Reply-To: References: In-Reply-To: References: X-Sender: jan.kiszka@web.de X-Provags-ID: V01U2FsdGVkX192fIHiCBELfomBG1ith5APyoxvXOLi9jVdasft zi7p8Y88TwJnMxHmXmCGiGQnwYubVJgZoSEo57H3RLLlWg2LIZ /f1vAqkk4= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 X-Received-From: 217.72.192.221 Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org Subject: [Qemu-devel] [PATCH v2 21/24] 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 --- 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");