[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 1/6] file_ram_alloc(): coding style fixes
From: |
Eduardo Habkost |
Subject: |
[Qemu-devel] [PATCH 1/6] file_ram_alloc(): coding style fixes |
Date: |
Mon, 2 Jul 2012 15:06:33 -0300 |
Cc: Blue Swirl <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>
---
exec.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/exec.c b/exec.c
index 8244d54..c8bfd27 100644
--- a/exec.c
+++ b/exec.c
@@ -2392,7 +2392,7 @@ static void *file_ram_alloc(RAMBlock *block,
unlink(filename);
free(filename);
- memory = (memory+hpagesize-1) & ~(hpagesize-1);
+ memory = (memory + hpagesize - 1) & ~(hpagesize - 1);
/*
* ftruncate is not supported by hugetlbfs in older
@@ -2400,8 +2400,9 @@ static void *file_ram_alloc(RAMBlock *block,
* If anything goes wrong with it under other filesystems,
* mmap will fail.
*/
- if (ftruncate(fd, memory))
+ if (ftruncate(fd, memory)) {
perror("ftruncate");
+ }
#ifdef MAP_POPULATE
/* NB: MAP_POPULATE won't exhaustively alloc all phys pages in the case
--
1.7.10.4
- [Qemu-devel] [RFC PATCH 0/6] option to not remove files inside -mem-path dir (v2), Eduardo Habkost, 2012/07/02
- [Qemu-devel] [PATCH 1/6] file_ram_alloc(): coding style fixes,
Eduardo Habkost <=
- [Qemu-devel] [PATCH 4/6] file_ram_alloc: change length argument to size_t (v2), Eduardo Habkost, 2012/07/02
- [Qemu-devel] [RFC PATCH 6/6] add -keep-mem-path-files option (v2), Eduardo Habkost, 2012/07/02
- [Qemu-devel] [PATCH 2/6] file_ram_alloc(): use g_strdup_printf() instead of asprintf(), Eduardo Habkost, 2012/07/02
- [Qemu-devel] [PATCH 3/6] vl.c: change mem_prealloc to bool (v2), Eduardo Habkost, 2012/07/02
- [Qemu-devel] [PATCH 5/6] file_ram_alloc(): extract temporary-file creation code to separate function (v2), Eduardo Habkost, 2012/07/02
- Re: [Qemu-devel] [RFC PATCH 0/6] option to not remove files inside -mem-path dir (v2), Daniel P. Berrange, 2012/07/02