Skip to content

Commit

Permalink
[PATCH] x86_64: Minor string functions optimizations
Browse files Browse the repository at this point in the history
 - Use tail call from clear_user to __clear_user to save some code size
 - Use standard memcpy for forward memmove

Signed-off-by: Andi Kleen <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Andi Kleen authored and Linus Torvalds committed Jun 26, 2006
1 parent 2ee60e1 commit 6bfa9bb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion arch/x86_64/lib/memmove.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
void *memmove(void * dest,const void *src,size_t count)
{
if (dest < src) {
__inline_memcpy(dest,src,count);
return memcpy(dest,src,count);
} else {
char *p = (char *) dest + count;
char *s = (char *) src + count;
Expand Down
2 changes: 1 addition & 1 deletion arch/x86_64/lib/usercopy.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ strncpy_from_user(char *dst, const char __user *src, long count)
{
long res = -EFAULT;
if (access_ok(VERIFY_READ, src, 1))
__do_strncpy_from_user(dst, src, count, res);
return __strncpy_from_user(dst, src, count);
return res;
}
EXPORT_SYMBOL(strncpy_from_user);
Expand Down

0 comments on commit 6bfa9bb

Please sign in to comment.