diff mbox series

[REPOST,4/5] powerpc: Use update_thread_flag()

Message ID 1526051104-15995-5-git-send-email-Dave.Martin@arm.com
State New
Headers show
Series Simplify setting thread flags to a particular value | expand

Commit Message

Dave Martin May 11, 2018, 3:05 p.m. UTC
This patch uses the new update_thread_flag() helper to simplify a
couple of if () set; else clear; constructs.

No functional change.

Signed-off-by: Dave Martin <Dave.Martin@arm.com>

Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
---
 arch/powerpc/include/asm/elf.h | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

-- 
2.1.4

Comments

Michael Ellerman May 15, 2018, 3:13 a.m. UTC | #1
Dave Martin <Dave.Martin@arm.com> writes:

> This patch uses the new update_thread_flag() helper to simplify a

> couple of if () set; else clear; constructs.

>

> No functional change.

>

> Signed-off-by: Dave Martin <Dave.Martin@arm.com>

> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>

> Cc: Paul Mackerras <paulus@samba.org>

> Cc: Michael Ellerman <mpe@ellerman.id.au>

> ---

>  arch/powerpc/include/asm/elf.h | 10 ++--------

>  1 file changed, 2 insertions(+), 8 deletions(-)

>

> diff --git a/arch/powerpc/include/asm/elf.h b/arch/powerpc/include/asm/elf.h

> index 548d9a4..136c9b1 100644

> --- a/arch/powerpc/include/asm/elf.h

> +++ b/arch/powerpc/include/asm/elf.h

> @@ -88,14 +88,8 @@ typedef elf_vrregset_t elf_fpxregset_t;

>  #ifdef __powerpc64__

>  # define SET_PERSONALITY(ex)					\

>  do {								\

> -	if (((ex).e_flags & 0x3) == 2)				\

> -		set_thread_flag(TIF_ELF2ABI);			\

> -	else							\

> -		clear_thread_flag(TIF_ELF2ABI);			\

> -	if ((ex).e_ident[EI_CLASS] == ELFCLASS32)		\

> -		set_thread_flag(TIF_32BIT);			\

> -	else							\

> -		clear_thread_flag(TIF_32BIT);			\

> +	update_thread_flag(TIF_ELF2ABI, ((ex).e_flags & 0x3) == 2);	\

> +	update_thread_flag(TIF_32BIT, (ex).e_ident[EI_CLASS] == ELFCLASS32); \

>  	if (personality(current->personality) != PER_LINUX32)	\

>  		set_personality(PER_LINUX |			\

>  			(current->personality & (~PER_MASK)));	\


Thanks for cleaning it up.

Acked-by: Michael Ellerman <mpe@ellerman.id.au>


cheers
diff mbox series

Patch

diff --git a/arch/powerpc/include/asm/elf.h b/arch/powerpc/include/asm/elf.h
index 548d9a4..136c9b1 100644
--- a/arch/powerpc/include/asm/elf.h
+++ b/arch/powerpc/include/asm/elf.h
@@ -88,14 +88,8 @@  typedef elf_vrregset_t elf_fpxregset_t;
 #ifdef __powerpc64__
 # define SET_PERSONALITY(ex)					\
 do {								\
-	if (((ex).e_flags & 0x3) == 2)				\
-		set_thread_flag(TIF_ELF2ABI);			\
-	else							\
-		clear_thread_flag(TIF_ELF2ABI);			\
-	if ((ex).e_ident[EI_CLASS] == ELFCLASS32)		\
-		set_thread_flag(TIF_32BIT);			\
-	else							\
-		clear_thread_flag(TIF_32BIT);			\
+	update_thread_flag(TIF_ELF2ABI, ((ex).e_flags & 0x3) == 2);	\
+	update_thread_flag(TIF_32BIT, (ex).e_ident[EI_CLASS] == ELFCLASS32); \
 	if (personality(current->personality) != PER_LINUX32)	\
 		set_personality(PER_LINUX |			\
 			(current->personality & (~PER_MASK)));	\