From: Daniel Walker <dwalker@mvista.com>
To: mingo@elte.hu
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH -rt] remove redundent checks
Date: Sat, 22 Apr 2006 08:05:04 -0700 [thread overview]
Message-ID: <200604221505.k3MF54Lr021983@dwalker1.mvista.com> (raw)
Don't need to check twice .. I also removed an old
printk from schedule() .
Signed-Off-By: Daniel Walker <dwalker@mvista.com>
Index: linux-2.6.16/init/main.c
===================================================================
--- linux-2.6.16.orig/init/main.c
+++ linux-2.6.16/init/main.c
@@ -727,7 +727,7 @@ static int init(void * unused)
prepare_namespace();
}
#ifdef CONFIG_PREEMPT_RT
- WARN_ON(irqs_disabled() || irqs_disabled());
+ WARN_ON(irqs_disabled());
#endif
#define DEBUG_COUNT (defined(CONFIG_DEBUG_RT_MUTEXES) + defined(CONFIG_DEBUG_PREEMPT) + defined(CONFIG_CRITICAL_PREEMPT_TIMING) + defined(CONFIG_CRITICAL_IRQSOFF_TIMING) + defined(CONFIG_LATENCY_TRACE) + defined(CONFIG_DEBUG_SLAB) + defined(CONFIG_DEBUG_PAGEALLOC))
@@ -794,7 +794,7 @@ static int init(void * unused)
ramdisk_execute_command);
}
#ifdef CONFIG_PREEMPT_RT
- WARN_ON(irqs_disabled() || irqs_disabled());
+ WARN_ON(irqs_disabled());
#endif
/*
Index: linux-2.6.16/kernel/printk.c
===================================================================
--- linux-2.6.16.orig/kernel/printk.c
+++ linux-2.6.16/kernel/printk.c
@@ -792,7 +792,7 @@ void release_console_sem(void)
* case only.
*/
#ifdef CONFIG_PREEMPT_RT
- if (!in_atomic() && !irqs_disabled() && !irqs_disabled())
+ if (!in_atomic() && !irqs_disabled())
#endif
if (wake_klogd && !oops_in_progress && waitqueue_active(&log_wait))
wake_up_interruptible(&log_wait);
Index: linux-2.6.16/kernel/sched.c
===================================================================
--- linux-2.6.16.orig/kernel/sched.c
+++ linux-2.6.16/kernel/sched.c
@@ -3509,12 +3509,10 @@ asmlinkage void __sched schedule(void)
/*
* Test if we have interrupts disabled.
*/
- if (unlikely(irqs_disabled() || irqs_disabled())) {
+ if (unlikely(irqs_disabled())) {
stop_trace();
- printk(KERN_ERR "BUG: scheduling with %s irqs disabled: "
- "%s/0x%08x/%d\n",
- (irqs_disabled()) ? "" : "raw ", current->comm,
- preempt_count(), current->pid);
+ printk(KERN_ERR "BUG: scheduling with irqs disabled: "
+ "%s/0x%08x/%d\n", current->comm, preempt_count(), current->pid);
print_symbol("caller is %s\n",
(long)__builtin_return_address(0));
dump_stack();
@@ -3577,7 +3575,7 @@ asmlinkage void __sched preempt_schedule
* If there is a non-zero preempt_count or interrupts are disabled,
* we do not want to preempt the current task. Just return..
*/
- if (unlikely(ti->preempt_count || irqs_disabled() || irqs_disabled()))
+ if (unlikely(ti->preempt_count || irqs_disabled()))
return;
need_resched:
@@ -6807,7 +6805,7 @@ void __might_sleep(char *file, int line)
#if defined(in_atomic)
static unsigned long prev_jiffy; /* ratelimiting */
- if ((in_atomic() || irqs_disabled() || irqs_disabled()) &&
+ if ((in_atomic() || irqs_disabled()) &&
system_state == SYSTEM_RUNNING && !oops_in_progress) {
if (debug_direct_keyboard && hardirq_count())
return;
Index: linux-2.6.16/lib/smp_processor_id.c
===================================================================
--- linux-2.6.16.orig/lib/smp_processor_id.c
+++ linux-2.6.16/lib/smp_processor_id.c
@@ -16,7 +16,7 @@ unsigned int notrace debug_smp_processor
if (likely(preempt_count))
goto out;
- if (irqs_disabled() || irqs_disabled())
+ if (irqs_disabled())
goto out;
/*
next reply other threads:[~2006-04-22 18:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-22 15:05 Daniel Walker [this message]
2006-05-03 20:46 ` Ingo Molnar
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=200604221505.k3MF54Lr021983@dwalker1.mvista.com \
--to=dwalker@mvista.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
/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®