Skip to content

Commit 8146c5b

Browse files
xry111chenhuacai
authored andcommitted
LoongArch: Slightly clean up drdtime()
As we are just discarding the stable clock ID, simply write it into $zero instead of allocating a temporary register. Signed-off-by: Xi Ruoyao <[email protected]> Signed-off-by: Huacai Chen <[email protected]>
1 parent eea673e commit 8146c5b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

arch/loongarch/include/asm/loongarch.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1098,12 +1098,11 @@
10981098

10991099
static __always_inline u64 drdtime(void)
11001100
{
1101-
int rID = 0;
11021101
u64 val = 0;
11031102

11041103
__asm__ __volatile__(
1105-
"rdtime.d %0, %1 \n\t"
1106-
: "=r"(val), "=r"(rID)
1104+
"rdtime.d %0, $zero\n\t"
1105+
: "=r"(val)
11071106
:
11081107
);
11091108
return val;

0 commit comments

Comments
 (0)