lkml.org 
[lkml]   [1996]   [Sep]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: signed int for interrupts??
On Sun, 8 Sep 1996, Steve wrote:

> After a little bit more of checking the kernel, I found that the integer value
> for the interrupts is sprintf()ed into the buffer to printed with a %d (signed)
> instead of a %u (unsigned). This tiny (and untested) patch against 2.0.18
> should fix the problem.
>
>
> --- linux/arch/i386/kernel/irq.c.orig Sun Sep 8 16:52:46 1996
> +++ linux/arch/i386/kernel/irq.c Sun Sep 8 16:53:00 1996
> - len += sprintf(buf+len, "%2d: %8d %c %s",
> + len += sprintf(buf+len, "%2d: %8u %c %s",

As long as this is being patched (assuming it's accepted by Linus), why
not also increase the length of the int count field? i.e.
endor:~# cat /proc/interrupts
0: 346628503 timer
1: 538 keyboard
2: 0 cascade
5: 1677204142 + cyclades
9: 12182505 53c8xx
10: 232935712 3c509
11: -2065905633 + cyclades
13: 1 math error

8 digits isn't enough for a busy or long running system. Why not bump
that %8d up to something like %20u so it'll be wide enough for 64-bit if
we ever get that.

------------------------------------------------------------------
Jon Lewis <jlewis@fdt.net> | Unsolicited commercial e-mail will
Network Administrator | be proof-read for $199/hr.
________Finger jlewis@inorganic5.fdt.net for PGP public key_______


\
 
 \ /
  Last update: 2005-03-22 13:38    [W:0.067 / U:0.576 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site