public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* [patch 2/3] IA64 signal: remove redundant code in setup_sigcontext()
@ 2007-12-13 23:58 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2007-12-13 23:58 UTC (permalink / raw)
  To: linux-ia64

From: Shi Weihua <shiwh@cn.fujitsu.com>

This patch removes some redundant code in the function setup_sigcontext().

The registers ar.ccv,b7,r14,ar.csd,ar.ssd,r2-r3 and r16-r31 are not
restored in restore_sigcontext() when (flags & IA64_SC_FLAG_IN_SYSCALL) is
true.  So we don't need to zero those variables in setup_sigcontext().

Signed-off-by: Shi Weihua <shiwh@cn.fujitsu.com>
Cc: "Luck, Tony" <tony.luck@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/ia64/kernel/signal.c |   10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff -puN arch/ia64/kernel/signal.c~ia64-signal-remove-redundant-code-in-setup_sigcontext arch/ia64/kernel/signal.c
--- a/arch/ia64/kernel/signal.c~ia64-signal-remove-redundant-code-in-setup_sigcontext
+++ a/arch/ia64/kernel/signal.c
@@ -280,15 +280,7 @@ setup_sigcontext (struct sigcontext __us
 	err |= __copy_to_user(&sc->sc_gr[15], &scr->pt.r15, 8);		/* r15 */
 	err |= __put_user(scr->pt.cr_iip + ia64_psr(&scr->pt)->ri, &sc->sc_ip);
 
-	if (flags & IA64_SC_FLAG_IN_SYSCALL) {
-		/* Clear scratch registers if the signal interrupted a system call. */
-		err |= __put_user(0, &sc->sc_ar_ccv);				/* ar.ccv */
-		err |= __put_user(0, &sc->sc_br[7]);				/* b7 */
-		err |= __put_user(0, &sc->sc_gr[14]);				/* r14 */
-		err |= __clear_user(&sc->sc_ar25, 2*8);			/* ar.csd & ar.ssd */
-		err |= __clear_user(&sc->sc_gr[2], 2*8);			/* r2-r3 */
-		err |= __clear_user(&sc->sc_gr[16], 16*8);			/* r16-r31 */
-	} else {
+	if (!(flags & IA64_SC_FLAG_IN_SYSCALL)) {
 		/* Copy scratch regs to sigcontext if the signal didn't interrupt a syscall. */
 		err |= __put_user(scr->pt.ar_ccv, &sc->sc_ar_ccv);		/* ar.ccv */
 		err |= __put_user(scr->pt.b7, &sc->sc_br[7]);			/* b7 */
_

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-12-13 23:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-13 23:58 [patch 2/3] IA64 signal: remove redundant code in setup_sigcontext() akpm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox