From: Paolo Bonzini <pbonzini@redhat.com>
To: Roman Kiryanov <rkir@google.com>,
richard.henderson@linaro.org, peter.maydell@linaro.org,
qemu-devel@nongnu.org
Cc: jansene@google.com, mett@google.com, jpcottin@google.com,
alex.bennee@linaro.org, berrange@redhat.com
Subject: Re: [PATCH v2] exec: don't use void* in pointer arithmetic in headers
Date: Fri, 21 Jun 2024 18:32:59 +0200 [thread overview]
Message-ID: <f09cd7a7-948b-4a86-91ba-94bf4e9d3222@redhat.com> (raw)
In-Reply-To: <20240620201654.598024-1-rkir@google.com>
On 6/20/24 22:16, Roman Kiryanov wrote:
> 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>
> Suggested-by: Paolo Bonzini <pbonzini@redhat.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;
Just "uint8_t *ptr" is enough; thanks for testing that it's enough.
Queued for the next pull request, thanks.
Paolo
> hwaddr xlat;
> hwaddr len;
> FlatView *fv;
prev parent reply other threads:[~2024-06-21 16:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-20 20:16 [PATCH v2] exec: don't use void* in pointer arithmetic in headers Roman Kiryanov
2024-06-21 6:41 ` Philippe Mathieu-Daudé
2024-06-26 21:41 ` Roman Kiryanov
2024-06-21 16:32 ` Paolo Bonzini [this message]
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=f09cd7a7-948b-4a86-91ba-94bf4e9d3222@redhat.com \
--to=pbonzini@redhat.com \
--cc=alex.bennee@linaro.org \
--cc=berrange@redhat.com \
--cc=jansene@google.com \
--cc=jpcottin@google.com \
--cc=mett@google.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=rkir@google.com \
/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).