[9/9] memory: Delete memory_region_big_endian
diff mbox series

Message ID faffd619a65fdab2dfcce3c75f3cffd4178875d7.1566588034.git.tony.nguyen@bt.com
State New
Headers show
Series
  • [1/9] exec: Map device_endian onto MemOp
Related show

Commit Message

Tony Nguyen Aug. 23, 2019, 7:42 p.m. UTC
memory_region_big_endian is no longer useful now we are consistently
using MemOp for endianness.

Signed-off-by: Tony Nguyen <tony.nguyen@bt.com>
---
 memory.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

Comments

Richard Henderson Aug. 24, 2019, 10:32 p.m. UTC | #1
On 8/23/19 12:42 PM, Tony Nguyen wrote:
> memory_region_big_endian is no longer useful now we are consistently
> using MemOp for endianness.
> 
> Signed-off-by: Tony Nguyen <tony.nguyen@bt.com>
> ---
>  memory.c | 11 +----------
>  1 file changed, 1 insertion(+), 10 deletions(-)

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


r~

Patch
diff mbox series

diff --git a/memory.c b/memory.c
index ee7559a18c..b647a8d3dd 100644
--- a/memory.c
+++ b/memory.c
@@ -343,15 +343,6 @@  static void flatview_simplify(FlatView *view)
     }
 }
 
-static bool memory_region_big_endian(MemoryRegion *mr)
-{
-#ifdef TARGET_WORDS_BIGENDIAN
-    return mr->ops->endianness != MO_LE;
-#else
-    return mr->ops->endianness == MO_BE;
-#endif
-}
-
 static void adjust_endianness(MemoryRegion *mr, uint64_t *data, MemOp op)
 {
     if ((op & MO_BSWAP) != mr->ops->endianness) {
@@ -555,7 +546,7 @@  static MemTxResult access_with_adjusted_size(hwaddr addr,
     /* FIXME: support unaligned access? */
     access_size = MAX(MIN(size, access_size_max), access_size_min);
     access_mask = MAKE_64BIT_MASK(0, access_size * 8);
-    if (memory_region_big_endian(mr)) {
+    if (mr->ops->endianness == MO_BE) {
         for (i = 0; i < size; i += access_size) {
             r |= access_fn(mr, addr + i, value, access_size,
                         (size - access_size - i) * 8, access_mask, attrs);