Skip to content

Commit 9dc3041

Browse files
Leonardo Braspalmer-dabbelt
authored andcommitted
riscv: Replace direct thread flag check with is_compat_task()
There is some code that detects compat mode into a task by checking the flag directly, and other code that check using the helper is_compat_task(). Since the helper already exists, use it instead of checking the flags directly. Signed-off-by: Leonardo Bras <leobras@redhat.com> Link: https://lore.kernel.org/r/20240103160024.70305-4-leobras@redhat.com Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
1 parent 6be7ee4 commit 9dc3041

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

arch/riscv/include/asm/elf.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ extern bool compat_elf_check_arch(Elf32_Ehdr *hdr);
5454

5555
#ifdef CONFIG_64BIT
5656
#ifdef CONFIG_COMPAT
57-
#define STACK_RND_MASK (test_thread_flag(TIF_32BIT) ? \
57+
#define STACK_RND_MASK (is_compat_task() ? \
5858
0x7ff >> (PAGE_SHIFT - 12) : \
5959
0x3ffff >> (PAGE_SHIFT - 12))
6060
#else

arch/riscv/include/asm/pgtable.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -882,7 +882,7 @@ static inline pte_t pte_swp_clear_exclusive(pte_t pte)
882882

883883
#ifdef CONFIG_COMPAT
884884
#define TASK_SIZE_32 (_AC(0x80000000, UL) - PAGE_SIZE)
885-
#define TASK_SIZE (test_thread_flag(TIF_32BIT) ? \
885+
#define TASK_SIZE (is_compat_task() ? \
886886
TASK_SIZE_32 : TASK_SIZE_64)
887887
#else
888888
#define TASK_SIZE TASK_SIZE_64

0 commit comments

Comments
 (0)