mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Jesper Juhl <jesper.juhl@gmail.com>
Cc: linux-kernel@vger.kernel.org, mingo@redhat.com, jesper.juhl@gmail.com
Subject: Re: [PATCH] i386, nmi: signed vs unsigned mixup
Date: Sat, 19 Nov 2005 16:28:05 -0800	[thread overview]
Message-ID: <20051119162805.47796de9.akpm@osdl.org> (raw)
In-Reply-To: <200511200010.33658.jesper.juhl@gmail.com>

Jesper Juhl <jesper.juhl@gmail.com> wrote:
>
> 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.
> 
> ...
> 
> --- 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) {
> 

-ETOOTRIVIAL.  The code as-is works OK, and we have these sorts of things
all over the tee.


  reply	other threads:[~2005-11-20  0:28 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-19 23:10 Jesper Juhl
2005-11-20  0:28 ` Andrew Morton [this message]
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

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=20051119162805.47796de9.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=jesper.juhl@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    /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

Powered by JetHome