From: Robert Reif <reif@earthlink.net>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH] exec.c remove unnecessary operators on functions
Date: Fri, 20 Feb 2009 13:11:21 -0500 [thread overview]
Message-ID: <499EF249.4000005@earthlink.net> (raw)
[-- Attachment #1: Type: text/plain, Size: 232 bytes --]
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?
[-- Attachment #2: exec.diff.txt --]
[-- Type: text/plain, Size: 1447 bytes --]
--- 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,
next reply other threads:[~2009-02-20 18:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-20 18:11 Robert Reif [this message]
2009-02-20 20:37 ` [Qemu-devel] [PATCH] exec.c remove unnecessary operators on functions Robert Reif
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=499EF249.4000005@earthlink.net \
--to=reif@earthlink.net \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.