Skip to content

Commit

Permalink
fs/proc: use nr_irqs
Browse files Browse the repository at this point in the history
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Yinghai Lu authored and Ingo Molnar committed Oct 16, 2008
1 parent a62c413 commit da27c11
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions fs/proc/proc_misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ static int show_stat(struct seq_file *p, void *v)
struct timespec boottime;
unsigned int *per_irq_sum;

per_irq_sum = kzalloc(sizeof(unsigned int)*NR_IRQS, GFP_KERNEL);
per_irq_sum = kzalloc(sizeof(unsigned int)*nr_irqs, GFP_KERNEL);
if (!per_irq_sum)
return -ENOMEM;

Expand All @@ -531,7 +531,7 @@ static int show_stat(struct seq_file *p, void *v)
softirq = cputime64_add(softirq, kstat_cpu(i).cpustat.softirq);
steal = cputime64_add(steal, kstat_cpu(i).cpustat.steal);
guest = cputime64_add(guest, kstat_cpu(i).cpustat.guest);
for (j = 0; j < NR_IRQS; j++) {
for (j = 0; j < nr_irqs; j++) {
unsigned int temp = kstat_cpu(i).irqs[j];
sum += temp;
per_irq_sum[j] += temp;
Expand Down Expand Up @@ -577,7 +577,7 @@ static int show_stat(struct seq_file *p, void *v)
}
seq_printf(p, "intr %llu", (unsigned long long)sum);

for (i = 0; i < NR_IRQS; i++)
for (i = 0; i < nr_irqs; i++)
seq_printf(p, " %u", per_irq_sum[i]);

seq_printf(p,
Expand Down Expand Up @@ -631,13 +631,13 @@ static const struct file_operations proc_stat_operations = {
*/
static void *int_seq_start(struct seq_file *f, loff_t *pos)
{
return (*pos <= NR_IRQS) ? pos : NULL;
return (*pos <= nr_irqs) ? pos : NULL;
}

static void *int_seq_next(struct seq_file *f, void *v, loff_t *pos)
{
(*pos)++;
if (*pos > NR_IRQS)
if (*pos > nr_irqs)
return NULL;
return pos;
}
Expand Down

0 comments on commit da27c11

Please sign in to comment.