diff options
| author | Alvin Chang <alvinga@andestech.com> | 2025-07-03 23:19:56 +0800 |
|---|---|---|
| committer | Anup Patel <anup@brainfault.org> | 2025-07-20 20:54:34 +0530 |
| commit | ea5abd1f5e33ed3afedc92686ec8bfd00bc49235 (patch) | |
| tree | e917fe60050c62f2c0a7806715f7647a5d4d64c6 /include | |
| parent | 61083eb504e853e18c57f9f5794f8318c267d091 (diff) | |
| download | opensbi-ea5abd1f5e33ed3afedc92686ec8bfd00bc49235.zip opensbi-ea5abd1f5e33ed3afedc92686ec8bfd00bc49235.tar.gz opensbi-ea5abd1f5e33ed3afedc92686ec8bfd00bc49235.tar.bz2 | |
lib: sbi: Remove redundant call to sbi_hart_expected_trap_addr()
The variable "sbi_hart_expected_trap" has already been extern variable.
Therefore, the program can directly refer to it instead of calling
sbi_hart_expected_trap_addr().
Signed-off-by: Alvin Chang <alvinga@andestech.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Link: https://lore.kernel.org/r/20250703151957.2545958-2-alvinga@andestech.com
Signed-off-by: Anup Patel <anup@brainfault.org>
Diffstat (limited to 'include')
| -rw-r--r-- | include/sbi/sbi_csr_detect.h | 4 | ||||
| -rw-r--r-- | include/sbi/sbi_hart.h | 4 |
2 files changed, 2 insertions, 6 deletions
diff --git a/include/sbi/sbi_csr_detect.h b/include/sbi/sbi_csr_detect.h index 89ba294..097c31c 100644 --- a/include/sbi/sbi_csr_detect.h +++ b/include/sbi/sbi_csr_detect.h @@ -18,7 +18,7 @@ ({ \ register ulong tinfo asm("a3") = (ulong)trap; \ register ulong ttmp asm("a4"); \ - register ulong mtvec = sbi_hart_expected_trap_addr(); \ + register ulong mtvec = (ulong)sbi_hart_expected_trap; \ register ulong ret = 0; \ ((struct sbi_trap_info *)(trap))->cause = 0; \ asm volatile( \ @@ -37,7 +37,7 @@ ({ \ register ulong tinfo asm("a3") = (ulong)trap; \ register ulong ttmp asm("a4"); \ - register ulong mtvec = sbi_hart_expected_trap_addr(); \ + register ulong mtvec = (ulong)sbi_hart_expected_trap; \ ((struct sbi_trap_info *)(trap))->cause = 0; \ asm volatile( \ "add %[ttmp], %[tinfo], zero\n" \ diff --git a/include/sbi/sbi_hart.h b/include/sbi/sbi_hart.h index dfbe8e4..82b19dc 100644 --- a/include/sbi/sbi_hart.h +++ b/include/sbi/sbi_hart.h @@ -134,10 +134,6 @@ int sbi_hart_reinit(struct sbi_scratch *scratch); int sbi_hart_init(struct sbi_scratch *scratch, bool cold_boot); extern void (*sbi_hart_expected_trap)(void); -static inline ulong sbi_hart_expected_trap_addr(void) -{ - return (ulong)sbi_hart_expected_trap; -} unsigned int sbi_hart_mhpm_mask(struct sbi_scratch *scratch); void sbi_hart_delegation_dump(struct sbi_scratch *scratch, |
