aboutsummaryrefslogtreecommitdiffstats
path: root/arch/alpha/lib
diff options
context:
space:
mode:
authorIvan Kokshaysky <ink@jurassic.park.msu.ru>2006-04-25 05:45:19 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-04-25 10:51:06 -0400
commit4d5c34ec7b007cfb0771a36996b009f194acbb2f (patch)
tree7658508b67f6aa03d5b38b68a197502068699ea8 /arch/alpha/lib
parent454ac778459bc70f0a9818a6a8fd974ced11de66 (diff)
[PATCH] Alpha: strncpy() fix
As it turned out after recent SCSI changes, strncpy() was broken - it mixed up the return values from __stxncpy() in registers $24 and $27. Thanks to Mathieu Chouquet-Stringer for tracking down the problem and providing an excellent test case. Signed-off-by: Ivan Kokshaysky <ink@jurassic.park.msu.ru> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/alpha/lib')
-rw-r--r--arch/alpha/lib/strncpy.S8
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/alpha/lib/strncpy.S b/arch/alpha/lib/strncpy.S
index 338551c7113c..bbdef1be5f95 100644
--- a/arch/alpha/lib/strncpy.S
+++ b/arch/alpha/lib/strncpy.S
@@ -43,8 +43,8 @@ strncpy:
43 43
44 .align 4 44 .align 4
45$multiword: 45$multiword:
46 subq $24, 1, $2 # clear the final bits in the prev word 46 subq $27, 1, $2 # clear the final bits in the prev word
47 or $2, $24, $2 47 or $2, $27, $2
48 zapnot $1, $2, $1 48 zapnot $1, $2, $1
49 subq $18, 1, $18 49 subq $18, 1, $18
50 50
@@ -70,8 +70,8 @@ $multiword:
70 bne $18, 0b 70 bne $18, 0b
71 71
721: ldq_u $1, 0($16) # clear the leading bits in the final word 721: ldq_u $1, 0($16) # clear the leading bits in the final word
73 subq $27, 1, $2 73 subq $24, 1, $2
74 or $2, $27, $2 74 or $2, $24, $2
75 75
76 zap $1, $2, $1 76 zap $1, $2, $1
77 stq_u $1, 0($16) 77 stq_u $1, 0($16)