[COMMITTED] hppa: Simplify handling of sanity check errors in clone.S

John David Anglin dave@parisc-linux.org
Sun Dec 22 15:17:44 GMT 2024


Comitted to 2.40 and master.

Dave
---

hppa: Simplify handling of sanity check errors in clone.S.

This simplifies the handling of sanity check errors in clone.S.
Adjusted a couple of comments to reflect current code.

Signed-off-by: John David Anglin <dave.anglin@bell.net>

diff --git a/sysdeps/unix/sysv/linux/hppa/clone.S b/sysdeps/unix/sysv/linux/hppa/clone.S
index c18163d0f7..e85e7f517f 100644
--- a/sysdeps/unix/sysv/linux/hppa/clone.S
+++ b/sysdeps/unix/sysv/linux/hppa/clone.S
@@ -90,6 +90,10 @@ ENTRY(__clone)
 	comib,=,n 0, %ret0, .LthreadStart
 	bv,n	%r0(%rp)
 
+.LerrorSanity:
+	/* Sanity checks failed, set errno to EINVAL.  */
+	ldi	-EINVAL, %ret0
+
 .LerrorRest:
 	/* Something bad happened -- no child created -- need a frame */
 	ldo	64(%sp),%sp
@@ -101,11 +105,6 @@ ENTRY(__clone)
 	bv	%r0(%rp)
 	ldo	-64(%sp), %sp
 
-.LerrorSanity:
-	/* Sanity checks failed, return -1, and set errno to EINVAL. */
-	b	.LerrorRest
-	ldi	-EINVAL, %ret0
-
 .LthreadStart:
 	/* Load up the arguments.  */
 	ldw	-60(%sp), %arg0
@@ -121,7 +120,7 @@ ENTRY(__clone)
 	ldi	__NR_exit, %r20
 
 	/* We should not return from exit.
-           We do not restore r4, or the stack state.  */
+           We do not restore the stack state.  */
 	iitlbp	%r0, (%sr0, %r0)
 
 PSEUDO_END(__clone)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/libc-alpha/attachments/20241222/2b6f4098/attachment.sig>


More information about the Libc-alpha mailing list