diff options
author | Leonardo Bras <[email protected]> | 2024-01-03 13:00:21 -0300 |
---|---|---|
committer | Palmer Dabbelt <[email protected]> | 2024-03-19 16:39:38 -0700 |
commit | 4c0b5a451675e9a95be98a16ddb889bb0486d2ad (patch) | |
tree | 09c9bf4c104c7bd2cfb5d09162e8c895c178dc01 /arch/riscv/kernel/ptrace.c | |
parent | 9dc30419248f78dfebea7a554ec212dd1d82f8d7 (diff) |
riscv: add compile-time test into is_compat_task()
Currently several places will test for CONFIG_COMPAT before testing
is_compat_task(), probably in order to avoid a run-time test into the task
structure.
Since is_compat_task() is an inlined function, it would be helpful to add a
compile-time test of CONFIG_COMPAT, making sure it always returns zero when
the option is not enabled during the kernel build.
With this, the compiler is able to understand in build-time that
is_compat_task() will always return 0, and optimize-out some of the extra
code introduced by the option.
This will also allow removing a lot #ifdefs that were introduced, and make
the code more clean.
Signed-off-by: Leonardo Bras <[email protected]>
Reviewed-by: Guo Ren <[email protected]>
Reviewed-by: Andy Chiu <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Palmer Dabbelt <[email protected]>
Diffstat (limited to 'arch/riscv/kernel/ptrace.c')
0 files changed, 0 insertions, 0 deletions