LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: WANG Cong <xiyou.wangcong@gmail.com>
To: Andrew Morton <akpm@osdl.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	WANG Cong <xiyou.wangcong@gmail.com>,
	David Miller <davem@davemloft.net>,
	"William L. Irwin" <wli@holomorphy.com>,
	sparclinux@vger.kernel.org
Subject: [PATCH 06/16] sparc(64): use get_personality()
Date: Sat, 23 Feb 2008 16:14:09 +0800	[thread overview]
Message-ID: <1203754519825-git-send-email-xiyou.wangcong@gmail.com> (raw)
In-Reply-To: <1203754509934-git-send-email-xiyou.wangcong@gmail.com>

Use get_personality() macro and other two tiny improvements.

Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>
Cc: David Miller <davem@davemloft.net>
Cc: William L. Irwin <wli@holomorphy.com>
Cc: sparclinux@vger.kernel.org

---
 arch/sparc/kernel/signal.c      |    2 +-
 arch/sparc64/kernel/signal32.c  |    2 +-
 arch/sparc64/kernel/sys_sparc.c |    6 +++---
 include/asm-sparc/namei.h       |    2 +-
 include/asm-sparc64/elf.h       |    2 +-
 include/asm-sparc64/namei.h     |    2 +-
 6 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/arch/sparc/kernel/signal.c b/arch/sparc/kernel/signal.c
index 9994cac..0464874 100644
--- a/arch/sparc/kernel/signal.c
+++ b/arch/sparc/kernel/signal.c
@@ -1010,7 +1010,7 @@ asmlinkage void do_signal(struct pt_regs * regs, unsigned long orig_i0, int rest
 #ifdef SVR4_SIGNAL_BROKEN
 	int svr4_signal = 0;
 #else
-	int svr4_signal = current->personality == PER_SVR4;
+	int svr4_signal = (get_personality() == PER_SVR4);
 #endif
 
 	cookie.restart_syscall = restart_syscall;
diff --git a/arch/sparc64/kernel/signal32.c b/arch/sparc64/kernel/signal32.c
index 8c1c121..e3bc993 100644
--- a/arch/sparc64/kernel/signal32.c
+++ b/arch/sparc64/kernel/signal32.c
@@ -1270,7 +1270,7 @@ void do_signal32(sigset_t *oldset, struct pt_regs * regs,
 	struct signal_deliver_cookie cookie;
 	struct k_sigaction ka;
 	int signr;
-	int svr4_signal = current->personality == PER_SVR4;
+	int svr4_signal = (get_personality() == PER_SVR4);
 	
 	cookie.restart_syscall = restart_syscall;
 	cookie.orig_i0 = orig_i0;
diff --git a/arch/sparc64/kernel/sys_sparc.c b/arch/sparc64/kernel/sys_sparc.c
index 134d801..3813ec7 100644
--- a/arch/sparc64/kernel/sys_sparc.c
+++ b/arch/sparc64/kernel/sys_sparc.c
@@ -372,7 +372,7 @@ void arch_pick_mmap_layout(struct mm_struct *mm)
 	 * bit is set, or if the expected stack growth is unlimited:
 	 */
 	if (!test_thread_flag(TIF_32BIT) ||
-	    (current->personality & ADDR_COMPAT_LAYOUT) ||
+	    (get_personality() & ADDR_COMPAT_LAYOUT) ||
 	    current->signal->rlim[RLIMIT_STACK].rlim_cur == RLIM_INFINITY ||
 	    sysctl_legacy_va_layout) {
 		mm->mmap_base = TASK_UNMAPPED_BASE + random_factor;
@@ -518,7 +518,7 @@ asmlinkage long sparc64_newuname(struct new_utsname __user *name)
 {
 	int ret = sys_newuname(name);
 	
-	if (current->personality == PER_LINUX32 && !ret) {
+	if (get_personality() == PER_LINUX32 && !ret) {
 		ret = (copy_to_user(name->machine, "sparc\0\0", 8)
 		       ? -EFAULT : 0);
 	}
@@ -529,7 +529,7 @@ asmlinkage long sparc64_personality(unsigned long personality)
 {
 	int ret;
 
-	if (current->personality == PER_LINUX32 &&
+	if (get_personality() == PER_LINUX32 &&
 	    personality == PER_LINUX)
 		personality = PER_LINUX32;
 	ret = sys_personality(personality);
diff --git a/include/asm-sparc/namei.h b/include/asm-sparc/namei.h
index f2461e8..b87f621 100644
--- a/include/asm-sparc/namei.h
+++ b/include/asm-sparc/namei.h
@@ -13,7 +13,7 @@
 
 static inline char * __emul_prefix(void)
 {
-	switch (current->personality) {
+	switch (get_personality()) {
 	case PER_SUNOS:
 		return SPARC_BSD_EMUL;
 	case PER_SVR4:
diff --git a/include/asm-sparc64/elf.h b/include/asm-sparc64/elf.h
index 11c8e68..2140dbe 100644
--- a/include/asm-sparc64/elf.h
+++ b/include/asm-sparc64/elf.h
@@ -211,7 +211,7 @@ do {	unsigned long new_flags = current_thread_info()->flags; \
 	/* flush_thread will update pgd cache */	\
 	if (ibcs2)					\
 		set_personality(PER_SVR4);		\
-	else if (current->personality != PER_LINUX32)	\
+	else if (get_personality() != PER_LINUX32)	\
 		set_personality(PER_LINUX);		\
 } while (0)
 
diff --git a/include/asm-sparc64/namei.h b/include/asm-sparc64/namei.h
index ccda19e..e6a1dd9 100644
--- a/include/asm-sparc64/namei.h
+++ b/include/asm-sparc64/namei.h
@@ -13,7 +13,7 @@
 
 static inline char * __emul_prefix(void)
 {
-	switch (current->personality) {
+	switch (get_personality()) {
 	case PER_SUNOS:
 		return SPARC_BSD_EMUL;
 	case PER_SVR4:
-- 
1.5.3.8


  reply	other threads:[~2008-02-23  8:31 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-23  8:14 [PATCH 00/16] (Resend) Use get_personality() WANG Cong
2008-02-23  8:14 ` [PATCH 01/16] Make the macro get_personality function-like WANG Cong
2008-02-23  8:14   ` [PATCH 02/16] mm: use get_personality() WANG Cong
2008-02-23  8:14     ` [PATCH 03/16] fs: " WANG Cong
2008-02-23  8:14       ` [PATCH 04/16] powerpc: " WANG Cong
2008-02-23  8:14         ` [PATCH 05/16] parisc: " WANG Cong
2008-02-23  8:14           ` WANG Cong [this message]
2008-02-23  8:14             ` [PATCH 07/16] arm: " WANG Cong
2008-02-23  8:14               ` [PATCH 08/16] x86: " WANG Cong
2008-02-23  8:14                 ` [PATCH 09/16] um: " WANG Cong
2008-02-23  8:14                   ` [PATCH 10/16] s390: " WANG Cong
2008-02-23  8:14                     ` [PATCH 11/16] mips: " WANG Cong
2008-02-23  8:14                       ` [PATCH 12/16] ia64: " WANG Cong
2008-02-23  8:14                         ` [PATCH 13/16] alpha: " WANG Cong
2008-02-23  8:14                           ` [PATCH 14/16] frv: " WANG Cong
2008-02-23  8:14                             ` [PATCH 15/16] mn10300: " WANG Cong
2008-02-23  8:14                               ` [PATCH 16/16] kernel: " WANG Cong
2008-02-23 12:03                             ` [PATCH 15/16] mn10300: " David Howells
2008-02-23 12:02                           ` [PATCH 14/16] frv: " David Howells
2008-02-23 10:08                 ` [PATCH 08/16] x86: " Ingo Molnar
2008-02-23 10:19                   ` Ingo Molnar
2008-02-23 10:39                     ` WANG Cong
2008-02-23  9:06           ` Accessor macros vs reference counting Matthew Wilcox
2008-02-23 12:46             ` David Newall
2008-02-23 14:56               ` Matthew Wilcox
2008-02-23  8:58   ` [PATCH 01/16] Make the macro get_personality function-like Bryan Wu
2008-02-23  8:51 ` [PATCH 00/16] (Resend) Use get_personality() Alexey Dobriyan
2008-02-23  8:59   ` WANG Cong
2008-02-23  9:27     ` Alexey Dobriyan
2008-02-23  9:56       ` WANG Cong
2008-02-23 18:37       ` Christoph Hellwig
2008-02-23 19:16         ` Andrew Morton
2008-02-24  4:03           ` WANG Cong
2008-02-25  2:14           ` [PATCH] Remove the macro get_personality WANG Cong
2008-02-23 12:02 ` [PATCH 01/16] Make the macro get_personality function-like David Howells

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=1203754519825-git-send-email-xiyou.wangcong@gmail.com \
    --to=xiyou.wangcong@gmail.com \
    --cc=akpm@osdl.org \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sparclinux@vger.kernel.org \
    --cc=wli@holomorphy.com \
    --subject='Re: [PATCH 06/16] sparc(64): use get_personality()' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).