[rtems commit] leon, l2cache: prevent unused diagnostic access

Daniel Hellstrom danielh at rtems.org
Thu Mar 11 16:51:34 UTC 2021


Module:    rtems
Branch:    master
Commit:    4e0735c650ef125b19845dfa050ff9a4aab636f3
Changeset: http://git.rtems.org/rtems/commit/?id=4e0735c650ef125b19845dfa050ff9a4aab636f3

Author:    Martin Aberg <maberg at gaisler.com>
Date:      Thu Nov 14 11:47:21 2019 +0100

leon, l2cache: prevent unused diagnostic access

---

 bsps/shared/grlib/l2c/l2c.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bsps/shared/grlib/l2c/l2c.c b/bsps/shared/grlib/l2c/l2c.c
index ddef0ad..4a443ed 100644
--- a/bsps/shared/grlib/l2c/l2c.c
+++ b/bsps/shared/grlib/l2c/l2c.c
@@ -894,9 +894,9 @@ int l2cache_diag_tag( int way, int index, struct l2cache_tag * tag)
 		return L2CACHE_ERR_EINVAL;
 	}
 
-	unsigned int val = l2cache_reg_diagtag(way,index);
-
 	if (tag){
+		unsigned int val = l2cache_reg_diagtag(way,index);
+
 		tag->tag   = l2cache_get_tag(val);
 		tag->valid = l2cache_tag_valid(val);
 		tag->dirty = l2cache_tag_dirty(val);



More information about the vc mailing list