Commit 2d56ea2d authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] Work around compiler error in proc_misc.c

From: Alan Stern <stern@rowland.harvard.edu>

A change which was recently applied to fs/proc/proc_misc.c included a comment
about splitting a seq_printf into two pieces to work around a bug in
gcc-2.95.3.  Unfortunately gcc-2.96 still chokes on the statements.  The
patch below makes it work better and tidies the code up a bit.
parent e78a0b7a
...@@ -391,24 +391,24 @@ int show_stat(struct seq_file *p, void *v) ...@@ -391,24 +391,24 @@ int show_stat(struct seq_file *p, void *v)
(unsigned long long)jiffies_64_to_clock_t(irq), (unsigned long long)jiffies_64_to_clock_t(irq),
(unsigned long long)jiffies_64_to_clock_t(softirq)); (unsigned long long)jiffies_64_to_clock_t(softirq));
for_each_cpu(i) { for_each_cpu(i) {
/* two separate calls here to work around gcc-2.95.3 ICE */
seq_printf(p, "cpu%d %llu %llu %llu ", /* Copy values here to work around gcc-2.95.3, gcc-2.96 */
user = kstat_cpu(i).cpustat.user;
nice = kstat_cpu(i).cpustat.nice;
system = kstat_cpu(i).cpustat.system;
idle = kstat_cpu(i).cpustat.idle;
iowait = kstat_cpu(i).cpustat.iowait;
irq = kstat_cpu(i).cpustat.irq;
softirq = kstat_cpu(i).cpustat.softirq;
seq_printf(p, "cpu%d %llu %llu %llu %llu %llu %llu %llu\n",
i, i,
(unsigned long long) (unsigned long long)jiffies_64_to_clock_t(user),
jiffies_64_to_clock_t(kstat_cpu(i).cpustat.user), (unsigned long long)jiffies_64_to_clock_t(nice),
(unsigned long long) (unsigned long long)jiffies_64_to_clock_t(system),
jiffies_64_to_clock_t(kstat_cpu(i).cpustat.nice), (unsigned long long)jiffies_64_to_clock_t(idle),
(unsigned long long) (unsigned long long)jiffies_64_to_clock_t(iowait),
jiffies_64_to_clock_t(kstat_cpu(i).cpustat.system)); (unsigned long long)jiffies_64_to_clock_t(irq),
seq_printf(p, "%llu %llu %llu %llu\n", (unsigned long long)jiffies_64_to_clock_t(softirq));
(unsigned long long)
jiffies_64_to_clock_t(kstat_cpu(i).cpustat.idle),
(unsigned long long)
jiffies_64_to_clock_t(kstat_cpu(i).cpustat.iowait),
(unsigned long long)
jiffies_64_to_clock_t(kstat_cpu(i).cpustat.irq),
(unsigned long long)
jiffies_64_to_clock_t(kstat_cpu(i).cpustat.softirq));
} }
seq_printf(p, "intr %llu", (unsigned long long)sum); seq_printf(p, "intr %llu", (unsigned long long)sum);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment