From: Dmitry Safonov <dsafonov@virtuozzo.com>
To: linux-kernel@vger.kernel.org
Cc: Dmitry Safonov <dsafonov@virtuozzo.com>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Paul Mackerras <paulus@samba.org>,
Michael Ellerman <mpe@ellerman.id.au>,
Andy Lutomirski <luto@amacapital.net>,
Oleg Nesterov <oleg@redhat.com>,
linuxppc-dev@lists.ozlabs.org, linux-mm@kvack.org
Subject: [PATCHv3 1/8] powerpc/vdso: unify return paths in setup_additional_pages
Date: Thu, 27 Oct 2016 20:09:41 +0300 [thread overview]
Message-ID: <20161027170948.8279-2-dsafonov@virtuozzo.com> (raw)
In-Reply-To: <20161027170948.8279-1-dsafonov@virtuozzo.com>
Impact: cleanup
Rename `rc' variable which doesn't seems to mean anything into
kernel-known `ret'. Combine two function returns into one as it's
also easier to read.
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: linuxppc-dev@lists.ozlabs.org
Cc: linux-mm@kvack.org
Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
---
arch/powerpc/kernel/vdso.c | 19 +++++++------------
1 file changed, 7 insertions(+), 12 deletions(-)
diff --git a/arch/powerpc/kernel/vdso.c b/arch/powerpc/kernel/vdso.c
index 4111d30badfa..4ffb82a2d9e9 100644
--- a/arch/powerpc/kernel/vdso.c
+++ b/arch/powerpc/kernel/vdso.c
@@ -154,7 +154,7 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
struct page **vdso_pagelist;
unsigned long vdso_pages;
unsigned long vdso_base;
- int rc;
+ int ret = 0;
if (!vdso_ready)
return 0;
@@ -203,8 +203,8 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
((VDSO_ALIGNMENT - 1) & PAGE_MASK),
0, 0);
if (IS_ERR_VALUE(vdso_base)) {
- rc = vdso_base;
- goto fail_mmapsem;
+ ret = vdso_base;
+ goto out_up_mmap_sem;
}
/* Add required alignment. */
@@ -227,21 +227,16 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
* It's fine to use that for setting breakpoints in the vDSO code
* pages though.
*/
- rc = install_special_mapping(mm, vdso_base, vdso_pages << PAGE_SHIFT,
+ ret = install_special_mapping(mm, vdso_base, vdso_pages << PAGE_SHIFT,
VM_READ|VM_EXEC|
VM_MAYREAD|VM_MAYWRITE|VM_MAYEXEC,
vdso_pagelist);
- if (rc) {
+ if (ret)
current->mm->context.vdso_base = 0;
- goto fail_mmapsem;
- }
-
- up_write(&mm->mmap_sem);
- return 0;
- fail_mmapsem:
+out_up_mmap_sem:
up_write(&mm->mmap_sem);
- return rc;
+ return ret;
}
const char *arch_vma_name(struct vm_area_struct *vma)
--
2.10.1
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2016-10-27 17:11 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-27 17:09 [PATCHv3 0/8] powerpc/mm: refactor vDSO mapping code Dmitry Safonov
2016-10-27 17:09 ` Dmitry Safonov [this message]
2016-11-08 0:10 ` [PATCHv3 1/8] powerpc/vdso: unify return paths in setup_additional_pages Michael Ellerman
2016-11-08 12:29 ` Dmitry Safonov
2016-10-27 17:09 ` [PATCHv3 2/8] powerpc/vdso: remove unused params in vdso_do_func_patch{32,64} Dmitry Safonov
2016-10-27 17:09 ` [PATCHv3 3/8] powerpc/vdso: separate common code in vdso_common Dmitry Safonov
2016-10-27 17:09 ` [PATCHv3 4/8] powerpc/vdso: introduce init_vdso{32,64}_pagelist Dmitry Safonov
2016-10-27 17:09 ` [PATCHv3 5/8] powerpc/vdso: split map_vdso from arch_setup_additional_pages Dmitry Safonov
2016-10-27 17:09 ` [PATCHv3 6/8] powerpc/vdso: switch from legacy_special_mapping_vmops Dmitry Safonov
2016-10-27 17:09 ` [PATCHv3 7/8] mm: kill arch_mremap Dmitry Safonov
2016-10-27 17:09 ` [PATCHv3 8/8] powerpc/vdso: remove arch_vma_name Dmitry Safonov
2016-11-07 11:21 ` [PATCHv3 0/8] powerpc/mm: refactor vDSO mapping code Dmitry Safonov
2016-11-07 23:57 ` Michael Ellerman
2016-11-08 12:47 ` Dmitry Safonov
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=20161027170948.8279-2-dsafonov@virtuozzo.com \
--to=dsafonov@virtuozzo.com \
--cc=benh@kernel.crashing.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=luto@amacapital.net \
--cc=mpe@ellerman.id.au \
--cc=oleg@redhat.com \
--cc=paulus@samba.org \
/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