summaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
authorChristian Borntraeger <borntraeger@de.ibm.com>2016-08-04 10:24:30 +0200
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2016-08-08 15:41:31 +0200
commite2efc424549eb66d227dfe6d073d1789a24bc698 (patch)
tree1c95439c4a7f1696fbcaf1a753ccb68e62137b47 /init
parent134a24cd895c5d138d639a0741ad27e389cd4562 (diff)
downloadlinux-e2efc424549eb66d227dfe6d073d1789a24bc698.tar.bz2
s390/lib: fix memcmp and strstr
if two string compare equal the clcle instruction will update the string addresses to point _after_ the string. This might already be on a different page, so we should not use these pointer to calculate the difference as in that case the calculation of the difference can cause oopses. The return value of memcmp does not need the difference, we can just reuse the condition code and return for CC=1 (All bytes compared, first operand low) -1 and for CC=2 (All bytes compared, first operand high) +1 strstr also does not need the diff. While fixing this, make the common function clcle "correct on its own" by using l1 instead of l2 for the first length. strstr will call this with l2 for both strings. Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Fixes: db7f5eef3dc0 ("s390/lib: use basic blocks for inline assemblies") Reviewed-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'init')
0 files changed, 0 insertions, 0 deletions