From: "Chen, Kenneth W" <kenneth.w.chen@intel.com>
To: linux-ia64@vger.kernel.org
Subject: RE: strcpy returns NULL pointer and not destination pointer
Date: Wed, 03 May 2006 18:53:43 +0000 [thread overview]
Message-ID: <4t16i2$tjcpe@orsmga001.jf.intel.com> (raw)
In-Reply-To: <20060503133806.GC19859@localhost>
Matthew Wilcox wrote on Wednesday, May 03, 2006 11:49 AM
> On Wed, May 03, 2006 at 11:46:07AM -0700, Chen, Kenneth W wrote:
> > - * 0 if success, or number of byte NOT copied if error occurred.
> > + * for memcpy: retrun dest
>
> typo
Thank you. I need a spell-o-matic checker :-)
[patch] fix return value of memcpy
Signed-off-by: Ken Chen <kenneth.w.chen@intel.com>
--- ./arch/ia64/lib/memcpy_mck.S.orig 2006-03-19 21:53:29.000000000 -0800
+++ ./arch/ia64/lib/memcpy_mck.S 2006-05-03 12:30:20.000000000 -0700
@@ -6,7 +6,9 @@
* in1: source address
* in2: number of bytes to copy
* Output:
- * 0 if success, or number of byte NOT copied if error occurred.
+ * for memcpy: return dest
+ * for copy_user: return 0 if success,
+ * or number of byte NOT copied if error occurred.
*
* Copyright (C) 2002 Intel Corp.
* Copyright (C) 2002 Ken Chen <kenneth.w.chen@intel.com>
@@ -73,6 +75,7 @@ GLOBAL_ENTRY(memcpy)
and r28=0x7,in0
and r29=0x7,in1
mov f6ð
+ mov retval=in0
br.cond.sptk .common_code
;;
END(memcpy)
@@ -84,7 +87,7 @@ GLOBAL_ENTRY(__copy_user)
mov f6ñ
mov saved_in0=in0 // save dest pointer
mov saved_in1=in1 // save src pointer
- mov saved_in2=in2 // save len
+ mov retval=r0 // initialize return value
;;
.common_code:
cmp.gt p15,p0=8,in2 // check for small size
@@ -92,7 +95,7 @@ GLOBAL_ENTRY(__copy_user)
cmp.ne p14,p0=0,r29 // check src alignment
add src0=0,in1
sub r30=8,r28 // for .align_dest
- mov retval=r0 // initialize return value
+ mov saved_in2=in2 // save len
;;
add dst0=0,in0
add dst1=1,in0 // dest odd index
prev parent reply other threads:[~2006-05-03 18:53 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-03 13:38 strcpy returns NULL pointer and not destination pointer Bob Picco
2006-05-03 18:08 ` Chen, Kenneth W
2006-05-03 18:30 ` Bob Picco
2006-05-03 18:46 ` Chen, Kenneth W
2006-05-03 18:48 ` Matthew Wilcox
2006-05-03 18:53 ` Chen, Kenneth W [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='4t16i2$tjcpe@orsmga001.jf.intel.com' \
--to=kenneth.w.chen@intel.com \
--cc=linux-ia64@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox