Skip to content

Commit

Permalink
core: riscv: Add missing initial value for read_tp()
Browse files Browse the repository at this point in the history
The stack variable "tp" should have its initial value.

Signed-off-by: Alvin Chang <alvinga@andestech.com>
  • Loading branch information
gagachang committed Jan 4, 2024
1 parent 944957f commit 4e9bfb9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/arch/riscv/include/riscv.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ static inline __noprof void mb(void)

static inline __noprof unsigned long read_tp(void)
{
unsigned long tp;
unsigned long tp = 0;

asm volatile("mv %0, tp" : "=&r"(tp));
return tp;
Expand Down

0 comments on commit 4e9bfb9

Please sign in to comment.