From: Chen Gang <xili_gchen_5257@hotmail.com>
To: 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>,
"oleg@redhat.com" <oleg@redhat.com>,
"emunson@akamai.com" <emunson@akamai.com>,
"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>
Cc: Linux Memory <linux-mm@kvack.org>,
kernel mailing list <linux-kernel@vger.kernel.org>
Subject: [PATCH] mm/mmap.c: Remove redundant statement "error = -ENOMEM"
Date: Mon, 5 Oct 2015 23:55:35 +0800 [thread overview]
Message-ID: <COL130-W55A6DE834A523637B79293B9480@phx.gbl> (raw)
[-- Attachment #1: Type: text/plain, Size: 818 bytes --]
>From 4150fd59c4aa35d36e81920ecb2a522c8c7b68b9 Mon Sep 17 00:00:00 2001
From: Chen Gang <gang.chen.5i5j@gmail.com>
Date: Mon, 5 Oct 2015 23:43:30 +0800
Subject: [PATCH] mm/mmap.c: Remove redundant statement "error = -ENOMEM"
It is still a little better to remove it, although it should be skipped
by "-O2".
Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
---
mm/mmap.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/mm/mmap.c b/mm/mmap.c
index 8393580..1da4600 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -1562,7 +1562,6 @@ unsigned long mmap_region(struct file *file, unsigned long addr,
}
/* Clear old maps */
- error = -ENOMEM;
while (find_vma_links(mm, addr, addr + len, &prev, &rb_link,
&rb_parent)) {
if (do_munmap(mm, addr, len))
--
1.9.3
[-- Attachment #2: 0001-mm-mmap.c-Remove-redundant-statement-error-ENOMEM.patch --]
[-- Type: application/octet-stream, Size: 777 bytes --]
From 4150fd59c4aa35d36e81920ecb2a522c8c7b68b9 Mon Sep 17 00:00:00 2001
From: Chen Gang <gang.chen.5i5j@gmail.com>
Date: Mon, 5 Oct 2015 23:43:30 +0800
Subject: [PATCH] mm/mmap.c: Remove redundant statement "error = -ENOMEM"
It is still a little better to remove it, although it should be skipped
by "-O2".
Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com>
---
mm/mmap.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/mm/mmap.c b/mm/mmap.c
index 8393580..1da4600 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -1562,7 +1562,6 @@ unsigned long mmap_region(struct file *file, unsigned long addr,
}
/* Clear old maps */
- error = -ENOMEM;
while (find_vma_links(mm, addr, addr + len, &prev, &rb_link,
&rb_parent)) {
if (do_munmap(mm, addr, len))
--
1.9.3
next reply other threads:[~2015-10-05 15:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-05 15:55 Chen Gang [this message]
2015-10-05 16:24 ` Oleg Nesterov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=COL130-W55A6DE834A523637B79293B9480@phx.gbl \
--to=xili_gchen_5257@hotmail.com \
--cc=aarcange@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=emunson@akamai.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.cz \
--cc=oleg@redhat.com \
--cc=pfeiner@google.com \
--cc=riel@redhat.com \
--cc=sasha.levin@oracle.com \
--cc=vishnu.ps@samsung.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox