Skip to content

Commit

Permalink
riscv: Remove some unnecessary macro guards
Browse files Browse the repository at this point in the history
If CONFIG_SMP is not enabled, riscv_cpuindex.c will not be compiled
anyway.

And for CONFIG_ARCH_FPU, if it's not enabled, riscv_fpucmp.c will not
be compiled.

So we can remove the unnecessary macro guard for up_cpu_index() and
up_fpucmp().

Signed-off-by: Huang Qi <[email protected]>
  • Loading branch information
no1wudi authored and xiaoxiang781216 committed Sep 26, 2024
1 parent 1eb151b commit d9b95c5
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 5 deletions.
2 changes: 0 additions & 2 deletions arch/risc-v/src/common/riscv_cpuindex.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,7 @@
*
****************************************************************************/

#ifdef CONFIG_SMP
int up_cpu_index(void)
{
return (int)riscv_mhartid();
}
#endif
3 changes: 0 additions & 3 deletions arch/risc-v/src/common/riscv_fpucmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@
* Pre-processor Definitions
****************************************************************************/

#ifdef CONFIG_ARCH_FPU

/****************************************************************************
* Public Functions
****************************************************************************/
Expand Down Expand Up @@ -63,4 +61,3 @@ bool up_fpucmp(const void *saveregs1, const void *saveregs2)
return memcmp(&regs1[INT_XCPT_REGS], &regs2[INT_XCPT_REGS],
INT_REG_SIZE * FPU_XCPT_REGS) == 0;
}
#endif /* CONFIG_ARCH_FPU */

0 comments on commit d9b95c5

Please sign in to comment.