lkml.org 
[lkml]   [2019]   [Jan]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch 2/2] proc/stat: Make the interrupt statistics more efficient
On Thu, 31 Jan 2019, Alexey Dobriyan wrote:

> On Wed, Jan 30, 2019 at 01:31:32PM +0100, Thomas Gleixner wrote:
> > +static void show_irq_gap(struct seq_file *p, int gap)
> > +{
> > + static const char zeros[] = " 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0";
> > +
> > + while (gap > 0) {
> > + int inc = min_t(int, gap, ARRAY_SIZE(zeros) / 2);
> > +
> > + seq_write(p, zeros, 2 * inc);
> > + gap -= inc;
> > + }
> > +}
> > +
> > +static void show_all_irqs(struct seq_file *p)
> > +{
> > + int i, next = 0;
> > +
> > + for_each_active_irq(i) {
> > + show_irq_gap(p, i - next);
> > + seq_put_decimal_ull(p, " ", kstat_irqs_usr(i));
> > + next = i + 1;
> > + }
> > + show_irq_gap(p, nr_irqs - next);
> > +}
>
> Every signed int can and should be unsigned int in this patch.
>

Indeed.

\
 
 \ /
  Last update: 2019-01-30 22:29    [W:0.031 / U:2.628 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site