lkml.org 
[lkml]   [2018]   [Jul]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC v3 PATCH 3/5] mm: refactor do_munmap() to extract the common part
On Sat 30-06-18 06:39:43, Yang Shi wrote:
> Introduces two new helper functions:
> * munmap_addr_sanity()
> * munmap_lookup_vma()
>
> They will be used by do_munmap() and the new do_munmap with zapping
> large mapping early in the later patch.
>
> There is no functional change, just code refactor.

There are whitespace changes which make the code much harder to review
than necessary.
> +static inline bool munmap_addr_sanity(unsigned long start, size_t len)
> {
> - unsigned long end;
> - struct vm_area_struct *vma, *prev, *last;
> + if ((offset_in_page(start)) || start > TASK_SIZE || len > TASK_SIZE - start)
> + return false;
>
> - if ((offset_in_page(start)) || start > TASK_SIZE || len > TASK_SIZE-start)
> - return -EINVAL;

e.g. here.
--
Michal Hocko
SUSE Labs

\
 
 \ /
  Last update: 2018-07-02 15:42    [W:0.190 / U:1.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site