From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Paul Durrant" <paul@xen.org>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Stefano Stabellini" <sstabellini@kernel.org>,
xen-devel@lists.xenproject.org,
"Anthony Perard" <anthony.perard@citrix.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Daniel Henrique Barboza" <dbarboza@ventanamicro.com>
Subject: [PATCH 2/3] sysemu/xen: Remove unreachable xen_ram_alloc() code
Date: Tue, 5 Sep 2023 14:21:41 +0200 [thread overview]
Message-ID: <20230905122142.5939-3-philmd@linaro.org> (raw)
In-Reply-To: <20230905122142.5939-1-philmd@linaro.org>
The xen_ram_alloc() call in softmmu/physmem.c is guarded
by checking for xen_enabled(), which evaluate to 'false'
when XEN is not built in. The compiler elide the function
call, and thus the inlined function is not used. Remove it.
Inspired-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
include/sysemu/xen.h | 10 +++-------
1 file changed, 3 insertions(+), 7 deletions(-)
diff --git a/include/sysemu/xen.h b/include/sysemu/xen.h
index 9b2d0b21ff..1f797a9abe 100644
--- a/include/sysemu/xen.h
+++ b/include/sysemu/xen.h
@@ -27,8 +27,6 @@ extern bool xen_allowed;
#define xen_enabled() (xen_allowed)
void xen_hvm_modified_memory(ram_addr_t start, ram_addr_t length);
-void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size,
- struct MemoryRegion *mr, Error **errp);
#else /* !CONFIG_XEN_IS_POSSIBLE */
@@ -38,12 +36,10 @@ static inline void xen_hvm_modified_memory(ram_addr_t start, ram_addr_t length)
{
/* nothing */
}
-static inline void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size,
- MemoryRegion *mr, Error **errp)
-{
- g_assert_not_reached();
-}
#endif /* CONFIG_XEN_IS_POSSIBLE */
+void xen_ram_alloc(ram_addr_t ram_addr, ram_addr_t size,
+ struct MemoryRegion *mr, Error **errp);
+
#endif
--
2.41.0
next prev parent reply other threads:[~2023-09-05 12:22 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-05 12:21 [PATCH 0/3] sysemu/accel: Simplify sysemu/xen.h Philippe Mathieu-Daudé
2023-09-05 12:21 ` [PATCH 1/3] sysemu/xen: Remove unuseful CONFIG_USER_ONLY header guard Philippe Mathieu-Daudé
2023-09-05 12:21 ` Philippe Mathieu-Daudé [this message]
2023-10-04 12:16 ` [PATCH 2/3] sysemu/xen: Remove unreachable xen_ram_alloc() code Michael Tokarev
2023-09-05 12:21 ` [PATCH 3/3] sysemu/xen: Allow elision of xen_hvm_modified_memory() Philippe Mathieu-Daudé
2023-09-06 9:43 ` David Hildenbrand
2023-10-04 9:17 ` [PATCH 0/3] sysemu/accel: Simplify sysemu/xen.h Philippe Mathieu-Daudé
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=20230905122142.5939-3-philmd@linaro.org \
--to=philmd@linaro.org \
--cc=anthony.perard@citrix.com \
--cc=dbarboza@ventanamicro.com \
--cc=paul@xen.org \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.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).