lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1441253691-5798-1-git-send-email-gang.chen.5i5j@gmail.com>
Date:	Thu,  3 Sep 2015 12:14:51 +0800
From:	gang.chen.5i5j@...il.com
To:	akpm@...ux-foundation.org, mhocko@...e.cz
Cc:	linux-mm@...ck.org, linux-kernel@...r.kernel.org,
	gchen_5i5j@...n.com, Chen Gang <gang.chen.5i5j@...il.com>
Subject: [PATCH] mm/mmap.c: Remove redundent 'get_area' function pointer in get_unmapped_area()

From: Chen Gang <gang.chen.5i5j@...il.com>

Call the function pointer directly, then let code a bit simpler.

Signed-off-by: Chen Gang <gang.chen.5i5j@...il.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@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ