Skip to content

Commit 67e959a

Browse files
hcahcaAlexander Gordeev
authored andcommitted
s390/uaccess: Cleanup noinstr __put_user()/__get_user() inline assembly constraints
Remove superfluous underscores, brackets, and early clobber to make the code a bit more readable. Acked-by: Alexander Gordeev <agordeev@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
1 parent 718056f commit 67e959a

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

arch/s390/include/asm/uaccess.h

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,14 @@ __put_user_##type##_noinstr(unsigned type __user *to, \
9999
int rc; \
100100
\
101101
asm volatile( \
102-
" lr 0,%[spec]\n" \
103-
"0: mvcos %[_to],%[_from],%[_size]\n" \
104-
"1: xr %[rc],%[rc]\n" \
102+
" lr %%r0,%[spec]\n" \
103+
"0: mvcos %[to],%[from],%[size]\n" \
104+
"1: lhi %[rc],0\n" \
105105
"2:\n" \
106106
EX_TABLE_UA_FAULT(0b, 2b, %[rc]) \
107107
EX_TABLE_UA_FAULT(1b, 2b, %[rc]) \
108-
: [rc] "=&d" (rc), [_to] "+Q" (*(to)) \
109-
: [_size] "d" (size), [_from] "Q" (*(from)), \
108+
: [rc] "=d" (rc), [to] "+Q" (*to) \
109+
: [size] "d" (size), [from] "Q" (*from), \
110110
[spec] "d" (__oac_spec.val) \
111111
: "cc", "0"); \
112112
return rc; \
@@ -183,16 +183,16 @@ __get_user_##type##_noinstr(unsigned type *to, \
183183
int rc; \
184184
\
185185
asm volatile( \
186-
" lr 0,%[spec]\n" \
187-
"0: mvcos 0(%[_to]),%[_from],%[_size]\n" \
188-
"1: xr %[rc],%[rc]\n" \
186+
" lr %%r0,%[spec]\n" \
187+
"0: mvcos 0(%[to]),%[from],%[size]\n" \
188+
"1: lhi %[rc],0\n" \
189189
"2:\n" \
190-
EX_TABLE_UA_LOAD_MEM(0b, 2b, %[rc], %[_to], %[_ksize]) \
191-
EX_TABLE_UA_LOAD_MEM(1b, 2b, %[rc], %[_to], %[_ksize]) \
192-
: [rc] "=&d" (rc), "=Q" (*(to)) \
193-
: [_size] "d" (size), [_from] "Q" (*(from)), \
194-
[spec] "d" (__oac_spec.val), [_to] "a" (to), \
195-
[_ksize] "K" (size) \
190+
EX_TABLE_UA_LOAD_MEM(0b, 2b, %[rc], %[to], %[ksize]) \
191+
EX_TABLE_UA_LOAD_MEM(1b, 2b, %[rc], %[to], %[ksize]) \
192+
: [rc] "=d" (rc), "=Q" (*to) \
193+
: [size] "d" (size), [from] "Q" (*from), \
194+
[spec] "d" (__oac_spec.val), [to] "a" (to), \
195+
[ksize] "K" (size) \
196196
: "cc", "0"); \
197197
return rc; \
198198
} \

0 commit comments

Comments
 (0)