From: Roman Kiryanov <rkir@google.com>
To: richard.henderson@linaro.org, peter.maydell@linaro.org,
pbonzini@redhat.com, qemu-devel@nongnu.org
Cc: jansene@google.com, mett@google.com, jpcottin@google.com,
alex.bennee@linaro.org, berrange@redhat.com,
Roman Kiryanov <rkir@google.com>
Subject: [PATCH v2] exec: don't use void* in pointer arithmetic in headers
Date: Thu, 20 Jun 2024 13:16:54 -0700 [thread overview]
Message-ID: <20240620201654.598024-1-rkir@google.com> (raw)
void* pointer arithmetic is a GCC extentension
which could not be available in other build
tools (e.g. C++). This changes removes this
assumption.
Google-Bug-Id: 331190993
Change-Id: I5a064853429f627c17a9213910811dea4ced6174
Signed-off-by: Roman Kiryanov <rkir@google.com>
---
v2: renamed from "use char* for pointer arithmetic"
and removed all explicit extra cast with
one typedef in memory.h.
include/exec/memory.h | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/include/exec/memory.h b/include/exec/memory.h
index b1713f30b8..b616338f05 100644
--- a/include/exec/memory.h
+++ b/include/exec/memory.h
@@ -2795,8 +2795,10 @@ MemTxResult address_space_write_rom(AddressSpace *as, hwaddr addr,
#define ARG1_DECL AddressSpace *as
#include "exec/memory_ldst_phys.h.inc"
+typedef uint8_t *MemoryRegionCachePtr;
+
struct MemoryRegionCache {
- void *ptr;
+ MemoryRegionCachePtr ptr;
hwaddr xlat;
hwaddr len;
FlatView *fv;
--
2.45.2.741.gdbec12cfda-goog
next reply other threads:[~2024-06-20 20:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-20 20:16 Roman Kiryanov [this message]
2024-06-21 6:41 ` [PATCH v2] exec: don't use void* in pointer arithmetic in headers Philippe Mathieu-Daudé
2024-06-26 21:41 ` Roman Kiryanov
2024-06-21 16:32 ` Paolo Bonzini
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=20240620201654.598024-1-rkir@google.com \
--to=rkir@google.com \
--cc=alex.bennee@linaro.org \
--cc=berrange@redhat.com \
--cc=jansene@google.com \
--cc=jpcottin@google.com \
--cc=mett@google.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).