From patchwork Sat Mar 26 20:06:55 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Weil X-Patchwork-Id: 88477 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 8F88CB6FA4 for ; Sun, 27 Mar 2011 07:08:48 +1100 (EST) Received: from localhost ([127.0.0.1]:43731 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q3Zmt-0003BC-Oq for incoming@patchwork.ozlabs.org; Sat, 26 Mar 2011 16:08:43 -0400 Received: from [140.186.70.92] (port=51458 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q3ZlS-00039g-Uz for qemu-devel@nongnu.org; Sat, 26 Mar 2011 16:07:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q3ZlR-0006Py-Pj for qemu-devel@nongnu.org; Sat, 26 Mar 2011 16:07:14 -0400 Received: from moutng.kundenserver.de ([212.227.17.10]:54003) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q3ZlR-0006Np-EG for qemu-devel@nongnu.org; Sat, 26 Mar 2011 16:07:13 -0400 Received: from flocke.fritz.box (p54ADA35D.dip.t-dialin.net [84.173.163.93]) by mrelayeu.kundenserver.de (node=mrbap1) with ESMTP (Nemesis) id 0M9NGg-1Q8Ytk3nV0-00CidK; Sat, 26 Mar 2011 21:07:03 +0100 Received: from stefan by flocke.fritz.box with local (Exim 4.72) (envelope-from ) id 1Q3ZlF-0003E3-9G; Sat, 26 Mar 2011 21:07:01 +0100 From: Stefan Weil To: QEMU Developers Date: Sat, 26 Mar 2011 21:06:55 +0100 Message-Id: <1301170017-12368-1-git-send-email-weil@mail.berlios.de> X-Mailer: git-send-email 1.7.2.5 X-Provags-ID: V02:K0:YiU6/6XC3HW0P/XUhUul6lmWJmz1uPzmBX+hU63vIjM 6oPH5OhYfwQPUVRc1mXEOEIM+l5DmffSD02jA/MKRd+pYtdVVJ Tx39imTvfnxz0JMIb/cInKTHYh4vHkP9LgJA9Vj3ga4TF/O6M8 daxd7q4zkIJHQUmWCWzDa6C6r7M759U2P+2nPcwI+LpNhvAZXu 99Wjo8XAkMxhpIo9PJuW4JFJQMAF5mIs1wVCkE7QpkYqj1POQR 9NRIB0pU5mR+g X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 212.227.17.10 Cc: Blue Swirl Subject: [Qemu-devel] [PATCH 1/3] cpu-common: Modify cpu_physical_memory_read and cpu_physical_memory_write 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 A lot of calls don't operate on bytes but on words or on structured data. So instead of a pointer to uint8_t, a void pointer is the better choice. This allows removing many type casts. (Some very early implementations of memcpy used char pointers which were replaced by void pointers for the same reason). Cc: Blue Swirl Signed-off-by: Stefan Weil --- cpu-common.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cpu-common.h b/cpu-common.h index ef4e8da..f44a2b0 100644 --- a/cpu-common.h +++ b/cpu-common.h @@ -68,12 +68,12 @@ void cpu_unregister_io_memory(int table_address); void cpu_physical_memory_rw(target_phys_addr_t addr, uint8_t *buf, int len, int is_write); static inline void cpu_physical_memory_read(target_phys_addr_t addr, - uint8_t *buf, int len) + void *buf, int len) { cpu_physical_memory_rw(addr, buf, len, 0); } static inline void cpu_physical_memory_write(target_phys_addr_t addr, - const uint8_t *buf, int len) + const void *buf, int len) { cpu_physical_memory_rw(addr, (uint8_t *)buf, len, 1); }