Skip to content

Commit 5da7615

Browse files
author
Martin Schwidefsky
committed
s390/vdso: remove NULL pointer check from clock_gettime
The explicit NULL pointer check on the timespec argument is only required for clock_getres but not for clock_gettime. Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
1 parent 6992860 commit 5da7615

2 files changed

Lines changed: 6 additions & 14 deletions

File tree

‎arch/s390/kernel/vdso32/clock_gettime.S‎

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,11 @@ __kernel_clock_gettime:
2222
basr %r5,0
2323
0: al %r5,21f-0b(%r5) /* get &_vdso_data */
2424
chi %r2,__CLOCK_REALTIME
25-
je 10f
25+
je 11f
2626
chi %r2,__CLOCK_MONOTONIC
2727
jne 19f
2828

2929
/* CLOCK_MONOTONIC */
30-
ltr %r3,%r3
31-
jz 9f /* tp == NULL */
3230
1: l %r4,__VDSO_UPD_COUNT+4(%r5) /* load update counter */
3331
tml %r4,0x0001 /* pending update ? loop */
3432
jnz 1b
@@ -67,12 +65,10 @@ __kernel_clock_gettime:
6765
j 6b
6866
8: st %r2,0(%r3) /* store tp->tv_sec */
6967
st %r1,4(%r3) /* store tp->tv_nsec */
70-
9: lhi %r2,0
68+
lhi %r2,0
7169
br %r14
7270

7371
/* CLOCK_REALTIME */
74-
10: ltr %r3,%r3 /* tp == NULL */
75-
jz 18f
7672
11: l %r4,__VDSO_UPD_COUNT+4(%r5) /* load update counter */
7773
tml %r4,0x0001 /* pending update ? loop */
7874
jnz 11b
@@ -111,7 +107,7 @@ __kernel_clock_gettime:
111107
j 15b
112108
17: st %r2,0(%r3) /* store tp->tv_sec */
113109
st %r1,4(%r3) /* store tp->tv_nsec */
114-
18: lhi %r2,0
110+
lhi %r2,0
115111
br %r14
116112

117113
/* Fallback to system call */

‎arch/s390/kernel/vdso64/clock_gettime.S‎

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ __kernel_clock_gettime:
2121
.cfi_startproc
2222
larl %r5,_vdso_data
2323
cghi %r2,__CLOCK_REALTIME
24-
je 4f
24+
je 5f
2525
cghi %r2,__CLOCK_THREAD_CPUTIME_ID
2626
je 9f
2727
cghi %r2,-2 /* Per-thread CPUCLOCK with PID=0, VIRT=1 */
@@ -30,8 +30,6 @@ __kernel_clock_gettime:
3030
jne 12f
3131

3232
/* CLOCK_MONOTONIC */
33-
ltgr %r3,%r3
34-
jz 3f /* tp == NULL */
3533
0: lg %r4,__VDSO_UPD_COUNT(%r5) /* load update counter */
3634
tmll %r4,0x0001 /* pending update ? loop */
3735
jnz 0b
@@ -53,12 +51,10 @@ __kernel_clock_gettime:
5351
j 1b
5452
2: stg %r0,0(%r3) /* store tp->tv_sec */
5553
stg %r1,8(%r3) /* store tp->tv_nsec */
56-
3: lghi %r2,0
54+
lghi %r2,0
5755
br %r14
5856

5957
/* CLOCK_REALTIME */
60-
4: ltr %r3,%r3 /* tp == NULL */
61-
jz 8f
6258
5: lg %r4,__VDSO_UPD_COUNT(%r5) /* load update counter */
6359
tmll %r4,0x0001 /* pending update ? loop */
6460
jnz 5b
@@ -80,7 +76,7 @@ __kernel_clock_gettime:
8076
j 6b
8177
7: stg %r0,0(%r3) /* store tp->tv_sec */
8278
stg %r1,8(%r3) /* store tp->tv_nsec */
83-
8: lghi %r2,0
79+
lghi %r2,0
8480
br %r14
8581

8682
/* CLOCK_THREAD_CPUTIME_ID for this thread */

0 commit comments

Comments
 (0)