Re: [Qemu-devel] [PATCH v3] util/mmap-alloc: check parameter before using

2016-10-31 Thread Cao jin
On 10/31/2016 03:32 PM, Thomas Huth wrote: On 31.10.2016 04:57, Cao jin wrote: Why did you change ptr to ptr1 here and above? Because, I think there always is: ptr + offset == ptr1 On linux, mmap(2) manpage says that address serves as hint, and the system create the mapping at a nearby

Re: [Qemu-devel] [PATCH v3] util/mmap-alloc: check parameter before using

2016-10-31 Thread Thomas Huth
On 31.10.2016 04:57, Cao jin wrote: > > > On 10/28/2016 10:22 PM, Michael Tokarev wrote: >> 28.10.2016 11:56, Cao jin wrote: >>> Also refactor a little bit for readability >> >> See comments below... >> >>> Signed-off-by: Cao jin >>> --- >>> util/mmap-alloc.c | 17 - >>> 1 fil

Re: [Qemu-devel] [PATCH v3] util/mmap-alloc: check parameter before using

2016-10-30 Thread Cao jin
On 10/28/2016 10:22 PM, Michael Tokarev wrote: 28.10.2016 11:56, Cao jin wrote: Also refactor a little bit for readability See comments below... Signed-off-by: Cao jin --- util/mmap-alloc.c | 17 - 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/util/mmap-

Re: [Qemu-devel] [PATCH v3] util/mmap-alloc: check parameter before using

2016-10-28 Thread Michael Tokarev
28.10.2016 11:56, Cao jin wrote: > Also refactor a little bit for readability See comments below... > Signed-off-by: Cao jin > --- > util/mmap-alloc.c | 17 - > 1 file changed, 8 insertions(+), 9 deletions(-) > > diff --git a/util/mmap-alloc.c b/util/mmap-alloc.c > index 5a85aa

[Qemu-devel] [PATCH v3] util/mmap-alloc: check parameter before using

2016-10-28 Thread Cao jin
Also refactor a little bit for readability Signed-off-by: Cao jin --- util/mmap-alloc.c | 17 - 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/util/mmap-alloc.c b/util/mmap-alloc.c index 5a85aa3..2f55f5e 100644 --- a/util/mmap-alloc.c +++ b/util/mmap-alloc.c @@ -12