diff mbox

[v2,2/3] linux-user/mmap.c: Remove useless variable p for mmap_frag

Message ID 1452502867-12148-2-git-send-email-chengang@emindsoft.com.cn
State New
Headers show

Commit Message

Chen Gang Jan. 11, 2016, 9:01 a.m. UTC
From: Chen Gang <chengang@emindsoft.com.cn>

It is useless.

Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
---
 linux-user/mmap.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff mbox

Patch

diff --git a/linux-user/mmap.c b/linux-user/mmap.c
index 7807ed0..51c381d 100644
--- a/linux-user/mmap.c
+++ b/linux-user/mmap.c
@@ -158,10 +158,10 @@  static int mmap_frag(abi_ulong real_start,
 
     if (prot1 == 0) {
         /* no page was there, so we allocate one */
-        void *p = mmap(host_start, qemu_host_page_size, prot,
-                       flags | MAP_ANONYMOUS, -1, 0);
-        if (p == MAP_FAILED)
+        if (mmap(host_start, qemu_host_page_size, prot, flags | MAP_ANONYMOUS,
+                 -1, 0) == MAP_FAILED) {
             return -1;
+        }
         page_set_flags(real_start, real_start + qemu_host_page_size,
                        PAGE_VALID);
         prot1 = prot;