From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LaZqR-0008KZ-Dw for qemu-devel@nongnu.org; Fri, 20 Feb 2009 13:11:27 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LaZqP-0008Jy-TC for qemu-devel@nongnu.org; Fri, 20 Feb 2009 13:11:27 -0500 Received: from [199.232.76.173] (port=55938 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LaZqP-0008Ju-Po for qemu-devel@nongnu.org; Fri, 20 Feb 2009 13:11:25 -0500 Received: from pop-tawny.atl.sa.earthlink.net ([207.69.195.67]:55299) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LaZqP-0006mj-Gf for qemu-devel@nongnu.org; Fri, 20 Feb 2009 13:11:25 -0500 Received: from user-142h2k8.cable.mindspring.com ([72.40.138.136] helo=[192.168.0.90]) by pop-tawny.atl.sa.earthlink.net with esmtp (Exim 3.36 #1) id 1LaZqM-0003vW-00 for qemu-devel@nongnu.org; Fri, 20 Feb 2009 13:11:22 -0500 Message-ID: <499EF249.4000005@earthlink.net> Date: Fri, 20 Feb 2009 13:11:21 -0500 From: Robert Reif MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------090509080403060805020006" Subject: [Qemu-devel] [PATCH] exec.c remove unnecessary operators on functions Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org This is a multi-part message in MIME format. --------------090509080403060805020006 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit This patch removes unnecessary *function and &function usage. Also, why is it necessary to take the address of a variable holding a function address rather than saving the function address directly in exec.c lines 2766 and 2771? --------------090509080403060805020006 Content-Type: text/plain; name="exec.diff.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="exec.diff.txt" --- exec.c (revision 6629) +++ exec.c (working copy) @@ -2658,7 +2658,7 @@ printf("%s: subpage %p len %d addr " TARGET_FMT_plx " idx %d\n", __func__, mmio, len, addr, idx); #endif - ret = (**mmio->mem_read[idx][len])(mmio->opaque[idx][0][len], + ret = (*mmio->mem_read[idx][len])(mmio->opaque[idx][0][len], addr + mmio->region_offset[idx][0][len]); return ret; @@ -2674,7 +2674,7 @@ printf("%s: subpage %p len %d addr " TARGET_FMT_plx " idx %d value %08x\n", __func__, mmio, len, addr, idx, value); #endif - (**mmio->mem_write[idx][len])(mmio->opaque[idx][1][len], + (*mmio->mem_write[idx][len])(mmio->opaque[idx][1][len], addr + mmio->region_offset[idx][1][len], value); } @@ -2733,16 +2733,16 @@ subpage_writelen(opaque, addr, value, 2); } -static CPUReadMemoryFunc *subpage_read[] = { - &subpage_readb, - &subpage_readw, - &subpage_readl, +static CPUReadMemoryFunc *subpage_read[3] = { + subpage_readb, + subpage_readw, + subpage_readl, }; -static CPUWriteMemoryFunc *subpage_write[] = { - &subpage_writeb, - &subpage_writew, - &subpage_writel, +static CPUWriteMemoryFunc *subpage_write[3] = { + subpage_writeb, + subpage_writew, + subpage_writel, }; static int subpage_register (subpage_t *mmio, uint32_t start, uint32_t end, --------------090509080403060805020006--