summaryrefslogtreecommitdiff
path: root/exec.c
diff options
context:
space:
mode:
authorBlue Swirl <blauwirbel@gmail.com>2009-07-31 21:16:51 +0000
committerBlue Swirl <blauwirbel@gmail.com>2009-07-31 21:16:51 +0000
commit5bc66fd30d90a2eabc04a9b627bde9382edd99d8 (patch)
tree1d133bdfc69d11fe81e769825adf3f680ee2f91e /exec.c
parentc374b2b20af70b7b88a6c463606ddf6c1a26298a (diff)
downloadqemu-5bc66fd30d90a2eabc04a9b627bde9382edd99d8.tar.gz
qemu-5bc66fd30d90a2eabc04a9b627bde9382edd99d8.tar.bz2
qemu-5bc66fd30d90a2eabc04a9b627bde9382edd99d8.zip
Fix Sparse warnings: "Using plain integer as NULL pointer"
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'exec.c')
-rw-r--r--exec.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/exec.c b/exec.c
index a4a7de7570..fa5b619cab 100644
--- a/exec.c
+++ b/exec.c
@@ -316,7 +316,7 @@ static inline PageDesc *page_find_alloc(target_ulong index)
#if defined(CONFIG_USER_ONLY)
size_t len = sizeof(PageDesc) * L2_SIZE;
/* Don't use qemu_malloc because it may recurse. */
- p = mmap(0, len, PROT_READ | PROT_WRITE,
+ p = mmap(NULL, len, PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
*lp = p;
if (h2g_valid(p)) {
@@ -341,8 +341,9 @@ static inline PageDesc *page_find(target_ulong index)
return NULL;
p = *lp;
- if (!p)
- return 0;
+ if (!p) {
+ return NULL;
+ }
return p + (index & (L2_SIZE - 1));
}