[04/10] exec/memory-internal: Check CONFIG_SOFTMMU instead of CONFIG_USER_ONLY
diff mbox series

Message ID 20200507173958.25894-5-philmd@redhat.com
State New
Headers show
Series
  • exec: Shear 'exec/ram_addr.h' and make NVMe device target-agnostic
Related show

Commit Message

Philippe Mathieu-Daudé May 7, 2020, 5:39 p.m. UTC
The CONFIG_SOFTMMU definition is poisoned in "exec/poison.h".
As this header is internal, check for poisoned CONFIG_SOFTMMU
instead of CONFIG_USER_ONLY to make this include harder to use.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
---
 include/exec/memory-internal.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Juan Quintela May 8, 2020, 8:01 a.m. UTC | #1
Philippe Mathieu-Daudé <philmd@redhat.com> wrote:
> The CONFIG_SOFTMMU definition is poisoned in "exec/poison.h".
> As this header is internal, check for poisoned CONFIG_SOFTMMU
> instead of CONFIG_USER_ONLY to make this include harder to use.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>>

Reviewed-by: Juan Quintela <quintela@redhat.com>

Patch
diff mbox series

diff --git a/include/exec/memory-internal.h b/include/exec/memory-internal.h
index 9fcc2af25c..b2b7c1e78a 100644
--- a/include/exec/memory-internal.h
+++ b/include/exec/memory-internal.h
@@ -22,7 +22,7 @@ 
 
 #include "cpu.h"
 
-#ifndef CONFIG_USER_ONLY
+#ifdef CONFIG_SOFTMMU
 static inline AddressSpaceDispatch *flatview_to_dispatch(FlatView *fv)
 {
     return fv->dispatch;