diff options
| author | Anup Patel <[email protected]> | 2022-04-28 19:35:39 +0530 |
|---|---|---|
| committer | Anup Patel <[email protected]> | 2022-05-07 10:06:57 +0530 |
| commit | a6ab94fdbf5f8bd7154ea86b8ee83f7ec394851a (patch) | |
| tree | d8586f09cc8d81b0e63a10e29785e6c1b4ad6416 | |
| parent | 97a17c2e5c38b0813bb4ab171cef893addf89cfe (diff) | |
lib: sbi: Fix AIA feature detection
The AIA feature detection uses unnecessary goto which is not need
and AIA case in sbi_hart_feature_id2string() does not break. This
patch fixes both issues in AIA feature detection.
Signed-off-by: Anup Patel <[email protected]>
Reviewed-by: Atish Patra <[email protected]>
| -rw-r--r-- | lib/sbi/sbi_hart.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/sbi/sbi_hart.c b/lib/sbi/sbi_hart.c index 5ee5ddda..fdfb6d97 100644 --- a/lib/sbi/sbi_hart.c +++ b/lib/sbi/sbi_hart.c @@ -408,6 +408,7 @@ static inline char *sbi_hart_feature_id2string(unsigned long feature) break; case SBI_HART_HAS_AIA: fstr = "aia"; + break; case SBI_HART_HAS_SSTC: fstr = "sstc"; break; @@ -632,10 +633,8 @@ __mhpm_skip: /* Detect if hart has AIA local interrupt CSRs */ csr_read_allowed(CSR_MTOPI, (unsigned long)&trap); - if (trap.cause) - goto __aia_skip; - hfeatures->features |= SBI_HART_HAS_AIA; -__aia_skip: + if (!trap.cause) + hfeatures->features |= SBI_HART_HAS_AIA; /* Detect if hart supports stimecmp CSR(Sstc extension) */ if (hfeatures->priv_version >= SBI_HART_PRIV_VER_1_12) { |
