mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@us.ibm.com>
To: linux-kernel@vger.kernel.org
Cc: akpm@osdl.org, mingo@elte.hu, oleg@tv-sign.ru,
	dipankar@in.ibm.com, hch@infradead.org
Subject: [PATCH] Remove duplicate code in signal.c
Date: Sat, 22 Oct 2005 20:22:26 -0700	[thread overview]
Message-ID: <20051023032226.GA6340@us.ibm.com> (raw)

Hello!

The following patch combines a bit of redundant code between
force_sig_info() and force_sig_specific().  Tested on x86 and ppc64.

Signed-off-by: paulmck@us.ibm.com

---

 signal.c |   12 ++----------
 1 files changed, 2 insertions(+), 10 deletions(-)

diff -urpNa -X dontdiff linux-2.6.14-rc2-rt7/kernel/signal.c linux-2.6.14-rc2-rt7-force_sig/kernel/signal.c
--- linux-2.6.14-rc2-rt7/kernel/signal.c	2005-09-29 13:57:15.000000000 -0700
+++ linux-2.6.14-rc2-rt7-force_sig/kernel/signal.c	2005-09-29 18:41:07.000000000 -0700
@@ -920,8 +920,8 @@ force_sig_info(int sig, struct siginfo *
 	if (sigismember(&t->blocked, sig) || t->sighand->action[sig-1].sa.sa_handler == SIG_IGN) {
 		t->sighand->action[sig-1].sa.sa_handler = SIG_DFL;
 		sigdelset(&t->blocked, sig);
-		recalc_sigpending_tsk(t);
 	}
+	recalc_sigpending_tsk(t);
 	ret = specific_send_sig_info(sig, info, t);
 	spin_unlock_irqrestore(&t->sighand->siglock, flags);
 
@@ -931,15 +931,7 @@ force_sig_info(int sig, struct siginfo *
 void
 force_sig_specific(int sig, struct task_struct *t)
 {
-	unsigned long int flags;
-
-	spin_lock_irqsave(&t->sighand->siglock, flags);
-	if (t->sighand->action[sig-1].sa.sa_handler == SIG_IGN)
-		t->sighand->action[sig-1].sa.sa_handler = SIG_DFL;
-	sigdelset(&t->blocked, sig);
-	recalc_sigpending_tsk(t);
-	specific_send_sig_info(sig, (void *)2, t);
-	spin_unlock_irqrestore(&t->sighand->siglock, flags);
+	force_sig_info(sig, (void *)2, t);
 }
 
 /*

             reply	other threads:[~2005-10-23  3:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-23  3:22 Paul E. McKenney [this message]
2005-10-23 10:56 ` Oleg Nesterov
2005-10-23 15:09   ` Paul E. McKenney

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=20051023032226.GA6340@us.ibm.com \
    --to=paulmck@us.ibm.com \
    --cc=akpm@osdl.org \
    --cc=dipankar@in.ibm.com \
    --cc=hch@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=oleg@tv-sign.ru \
    /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

all inboxes | Powered by JetHome®