diff mbox series

[8/9] exec: Delete DEVICE_HOST_ENDIAN

Message ID 11377fa49c502c61e74f5cab4d20ea89e317597b.1566588034.git.tony.nguyen@bt.com
State New
Headers show
Series [1/9] exec: Map device_endian onto MemOp | expand

Commit Message

Tony Nguyen Aug. 23, 2019, 7:42 p.m. UTC
Simplify code with MemOp short hand for host endianness, 0.

 typedef enum MemOp {
     /* snip */
 #ifdef HOST_WORDS_BIGENDIAN
     MO_LE    = MO_BSWAP,
     MO_BE    = 0,
 #else
     MO_LE    = 0,
     MO_BE    = MO_BSWAP,
 #endif
     /* snip */
 };

Signed-off-by: Tony Nguyen <tony.nguyen@bt.com>
---
 include/exec/cpu-common.h | 8 --------
 memory.c                  | 2 +-
 2 files changed, 1 insertion(+), 9 deletions(-)

Comments

Richard Henderson Aug. 24, 2019, 10:31 p.m. UTC | #1
On 8/23/19 12:42 PM, Tony Nguyen wrote:
> Simplify code with MemOp short hand for host endianness, 0.
> 
>  typedef enum MemOp {
>      /* snip */
>  #ifdef HOST_WORDS_BIGENDIAN
>      MO_LE    = MO_BSWAP,
>      MO_BE    = 0,
>  #else
>      MO_LE    = 0,
>      MO_BE    = MO_BSWAP,
>  #endif
>      /* snip */
>  };
> 
> Signed-off-by: Tony Nguyen <tony.nguyen@bt.com>
> ---
>  include/exec/cpu-common.h | 8 --------
>  memory.c                  | 2 +-
>  2 files changed, 1 insertion(+), 9 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~
diff mbox series

Patch

diff --git a/include/exec/cpu-common.h b/include/exec/cpu-common.h
index 7eeb78c48b..b33dc0c9f5 100644
--- a/include/exec/cpu-common.h
+++ b/include/exec/cpu-common.h
@@ -16,14 +16,6 @@  void tcg_flush_softmmu_tlb(CPUState *cs);
 
 #if !defined(CONFIG_USER_ONLY)
 
-#include "exec/memop.h"
-
-#if defined(HOST_WORDS_BIGENDIAN)
-#define DEVICE_HOST_ENDIAN MO_BE
-#else
-#define DEVICE_HOST_ENDIAN MO_LE
-#endif
-
 /* address in the RAM (different from a physical address) */
 #if defined(CONFIG_XEN_BACKEND)
 typedef uint64_t ram_addr_t;
diff --git a/memory.c b/memory.c
index d78d6e46db..ee7559a18c 100644
--- a/memory.c
+++ b/memory.c
@@ -1353,7 +1353,7 @@  static void memory_region_ram_device_write(void *opaque, hwaddr addr,
 static const MemoryRegionOps ram_device_mem_ops = {
     .read = memory_region_ram_device_read,
     .write = memory_region_ram_device_write,
-    .endianness = DEVICE_HOST_ENDIAN,
+    .endianness = 0, /* Host endianness */
     .valid = {
         .min_access_size = 1,
         .max_access_size = 8,