[PATCH 1/2] lib: sbi_hart: No need to clear features in hart_detect_features()

Anup Patel <[email protected]>
Newsgroups org.infradead.lists.opensbi
Message-ID <[email protected]>
The per-hart features are already zeroed by sbi_scratch_alloc_offset()
for all harts so hart_detect_features() should not explicitly clear
features later.

Signed-off-by: Anup Patel <[email protected]>
---
 lib/sbi/sbi_hart.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/lib/sbi/sbi_hart.c b/lib/sbi/sbi_hart.c
index 0f690f53..e7360712 100644
--- a/lib/sbi/sbi_hart.c
+++ b/lib/sbi/sbi_hart.c
@@ -520,13 +520,6 @@ static int hart_detect_features(struct sbi_scratch *scratch)
 	if (hfeatures->detected)
 		return 0;
 
-	/* Clear hart features */
-	sbi_memset(hfeatures->extensions, 0, sizeof(hfeatures->extensions));
-	sbi_memset(hfeatures->csrs, 0, sizeof(hfeatures->csrs));
-	hfeatures->pmp_count = 0;
-	hfeatures->mhpm_mask = 0;
-	hfeatures->priv_version = SBI_HART_PRIV_VER_UNKNOWN;
-
 	/*
 	 * Parse device tree extensions early, before any trap-based checks.
 	 * Needed to detect Smrnmi and install NMI handlers before CSR probes
-- 
2.43.0


-- 
opensbi mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/opensbi
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.