Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1220150
| Path | csiph.com!eternal-september.org!feeder.eternal-september.org!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Oleg Nesterov <oleg@redhat.com> |
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] mm/mmap.c: Remove redundent 'get_area' function pointer in get_unmapped_area() |
| Date | Mon, 07 Sep 2015 14:50:02 +0200 |
| Message-ID | <q641Y-5PD-15@gated-at.bofh.it> (permalink) |
| References | <q5mki-2Hy-17@gated-at.bofh.it> |
| X-Original-To | Chen Gang <xili_gchen_5257@hotmail.com> |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=iso-8859-1 |
| Content-Disposition | inline |
| Content-Transfer-Encoding | 8bit |
| User-Agent | Mutt/1.5.18 (2008-05-17) |
| X-Scanned-By | MIMEDefang 2.68 on 10.5.11.23 |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 65 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | Andrew Morton <akpm@linux-foundation.org>, "kirill.shutemov@linux.intel.com" <kirill.shutemov@linux.intel.com>, "riel@redhat.com" <riel@redhat.com>, Michal Hocko <mhocko@suse.cz>, "sasha.levin@oracle.com" <sasha.levin@oracle.com>, "pfeiner@google.com" <pfeiner@google.com>, "aarcange@redhat.com" <aarcange@redhat.com>, "vishnu.ps@samsung.com" <vishnu.ps@samsung.com>, Linux Memory <linux-mm@kvack.org>, kernel mailing list <linux-kernel@vger.kernel.org> |
| X-Original-Date | Mon, 7 Sep 2015 14:41:49 +0200 |
| X-Original-Message-ID | <20150907124148.GB32668@redhat.com> |
| X-Original-References | <COL130-W16C972B0457D5C7C9CB06B9560@phx.gbl> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1220150 |
Show key headers only | View raw
On 09/05, Chen Gang wrote:
>
> From a1bf4726f71d6d0394b41309944646fc806a8a0c Mon Sep 17 00:00:00 2001
> From: Chen Gang <gang.chen.5i5j@gmail.com>
> Date: Sat, 5 Sep 2015 21:51:08 +0800
> Subject: [PATCH] mm/mmap.c: Remove redundent 'get_area' function pointer in
> get_unmapped_area()
>
> Call the function pointer directly, then let code a bit simpler.
^^^^^^^^^^^^^^^^^^
This is subjective you know ;)
I guess the author of this code added this variable to make the code
more readable. And to me it becomes less readable after your change.
I leave this to you and maintainers.
> Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
> ---
> mm/mmap.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/mm/mmap.c b/mm/mmap.c
> index 4db7cf0..39fd727 100644
> --- a/mm/mmap.c
> +++ b/mm/mmap.c
> @@ -2012,10 +2012,8 @@ unsigned long
> get_unmapped_area(struct file *file, unsigned long addr, unsigned long len,
> unsigned long pgoff, unsigned long flags)
> {
> - unsigned long (*get_area)(struct file *, unsigned long,
> - unsigned long, unsigned long, unsigned long);
> -
> unsigned long error = arch_mmap_check(addr, len, flags);
> +
> if (error)
> return error;
>
> @@ -2023,10 +2021,12 @@ get_unmapped_area(struct file *file, unsigned long addr, unsigned long len,
> if (len> TASK_SIZE)
> return -ENOMEM;
>
> - get_area = current->mm->get_unmapped_area;
> if (file && file->f_op->get_unmapped_area)
> - get_area = file->f_op->get_unmapped_area;
> - addr = get_area(file, addr, len, pgoff, flags);
> + addr = file->f_op->get_unmapped_area(file, addr, len,
> + pgoff, flags);
> + else
> + addr = current->mm->get_unmapped_area(file, addr, len,
> + pgoff, flags);
> if (IS_ERR_VALUE(addr))
> return addr;
>
> --
> 1.9.3
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH] mm/mmap.c: Remove redundent 'get_area' function pointer in get_unmapped_area() Chen Gang <xili_gchen_5257@hotmail.com> - 2015-09-05 16:10 +0200 Re: [PATCH] mm/mmap.c: Remove redundent 'get_area' function pointer in get_unmapped_area() Oleg Nesterov <oleg@redhat.com> - 2015-09-07 14:50 +0200 Re: [PATCH] mm/mmap.c: Remove redundent 'get_area' function pointer in get_unmapped_area() Chen Gang <xili_gchen_5257@hotmail.com> - 2015-09-08 16:10 +0200 Re: [PATCH] mm/mmap.c: Remove redundent 'get_area' function pointer in get_unmapped_area() David Rientjes <rientjes@google.com> - 2015-09-09 01:30 +0200
csiph-web