mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] i386, nmi: signed vs unsigned mixup
@ 2005-11-19 23:10 Jesper Juhl
  2005-11-20  0:28 ` Andrew Morton
  0 siblings, 1 reply; 9+ messages in thread
From: Jesper Juhl @ 2005-11-19 23:10 UTC (permalink / raw)
  To: Linux Kernel Mailing List; +Cc: Andrew Morton, Ingo Molnar, Jesper Juhl

In arch/i386/kernel/nmi.c::nmi_watchdog_tick(), the variable `sum' is 
of type "int" but it's used to store the result of 
per_cpu(irq_stat, cpu).apic_timer_irqs which is an "unsigned int", it's
also later compared to last_irq_sums[cpu] which is also an 
"unsigned int", so `sum' really ought to be unsigned itself.
This small patch makes that change.


Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
---

 arch/i386/kernel/nmi.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)

--- linux-2.6.15-rc1-git7-orig/arch/i386/kernel/nmi.c	2005-11-12 18:07:14.000000000 +0100
+++ linux-2.6.15-rc1-git7/arch/i386/kernel/nmi.c	2005-11-19 23:58:17.000000000 +0100
@@ -528,9 +528,10 @@ void nmi_watchdog_tick (struct pt_regs *
 	 * Since current_thread_info()-> is always on the stack, and we
 	 * always switch the stack NMI-atomically, it's safe to use
 	 * smp_processor_id().
 	 */
-	int sum, cpu = smp_processor_id();
+	unsigned int sum;
+	int cpu = smp_processor_id();
 
 	sum = per_cpu(irq_stat, cpu).apic_timer_irqs;
 
 	if (last_irq_sums[cpu] == sum) {




^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2005-11-21 20:21 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-19 23:10 [PATCH] i386, nmi: signed vs unsigned mixup Jesper Juhl
2005-11-20  0:28 ` Andrew Morton
2005-11-20  0:30   ` Jesper Juhl
2005-11-20  1:08     ` Andrew Morton
2005-11-20  1:15       ` Jesper Juhl
2005-11-20  1:33         ` Andrew Morton
2005-11-20  1:45           ` Jesper Juhl
2005-11-21 10:40             ` Jesper Juhl
2005-11-21 20:20               ` Andrew Morton

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

Powered by JetHome