From: "Dirk Müller" <dmueller@suse.de>
To: linux-fsdevel@vger.kernel.org
Cc: "Dirk Müller" <dmueller@suse.de>
Subject: [PATCH] fs/proc: remove workaround for obsolete compiler version
Date: Mon, 18 Jul 2022 16:19:19 +0200 [thread overview]
Message-ID: <20220718141919.5384-1-dmueller@suse.de> (raw)
GCC 5.1+ is required, so with this change we can remove a
workaround for a really obsolete compiler version issue.
Signed-off-by: Dirk Müller <dmueller@suse.de>
---
fs/proc/stat.c | 32 ++++++++++----------------------
1 file changed, 10 insertions(+), 22 deletions(-)
diff --git a/fs/proc/stat.c b/fs/proc/stat.c
index 4fb8729a68d4..9eaa59fab7bf 100644
--- a/fs/proc/stat.c
+++ b/fs/proc/stat.c
@@ -167,29 +167,17 @@ static int show_stat(struct seq_file *p, void *v)
u64 *cpustat = kcpustat.cpustat;
kcpustat_cpu_fetch(&kcpustat, i);
-
- /* Copy values here to work around gcc-2.95.3, gcc-2.96 */
- user = cpustat[CPUTIME_USER];
- nice = cpustat[CPUTIME_NICE];
- system = cpustat[CPUTIME_SYSTEM];
- idle = get_idle_time(&kcpustat, i);
- iowait = get_iowait_time(&kcpustat, i);
- irq = cpustat[CPUTIME_IRQ];
- softirq = cpustat[CPUTIME_SOFTIRQ];
- steal = cpustat[CPUTIME_STEAL];
- guest = cpustat[CPUTIME_GUEST];
- guest_nice = cpustat[CPUTIME_GUEST_NICE];
seq_printf(p, "cpu%d", i);
- seq_put_decimal_ull(p, " ", nsec_to_clock_t(user));
- seq_put_decimal_ull(p, " ", nsec_to_clock_t(nice));
- seq_put_decimal_ull(p, " ", nsec_to_clock_t(system));
- seq_put_decimal_ull(p, " ", nsec_to_clock_t(idle));
- seq_put_decimal_ull(p, " ", nsec_to_clock_t(iowait));
- seq_put_decimal_ull(p, " ", nsec_to_clock_t(irq));
- seq_put_decimal_ull(p, " ", nsec_to_clock_t(softirq));
- seq_put_decimal_ull(p, " ", nsec_to_clock_t(steal));
- seq_put_decimal_ull(p, " ", nsec_to_clock_t(guest));
- seq_put_decimal_ull(p, " ", nsec_to_clock_t(guest_nice));
+ seq_put_decimal_ull(p, " ", nsec_to_clock_t(cpustat[CPUTIME_USER]));
+ seq_put_decimal_ull(p, " ", nsec_to_clock_t(cpustat[CPUTIME_NICE]));
+ seq_put_decimal_ull(p, " ", nsec_to_clock_t(cpustat[CPUTIME_SYSTEM]));
+ seq_put_decimal_ull(p, " ", nsec_to_clock_t(get_idle_time(&kcpustat, i)));
+ seq_put_decimal_ull(p, " ", nsec_to_clock_t(get_iowait_time(&kcpustat, i)));
+ seq_put_decimal_ull(p, " ", nsec_to_clock_t(cpustat[CPUTIME_IRQ]));
+ seq_put_decimal_ull(p, " ", nsec_to_clock_t(cpustat[CPUTIME_SOFTIRQ]));
+ seq_put_decimal_ull(p, " ", nsec_to_clock_t(cpustat[CPUTIME_STEAL]));
+ seq_put_decimal_ull(p, " ", nsec_to_clock_t(cpustat[CPUTIME_GUEST]));
+ seq_put_decimal_ull(p, " ", nsec_to_clock_t(cpustat[CPUTIME_GUEST_NICE]));
seq_putc(p, '\n');
}
seq_put_decimal_ull(p, "intr ", (unsigned long long)sum);
--
2.37.1
reply other threads:[~2022-07-18 14:19 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20220718141919.5384-1-dmueller@suse.de \
--to=dmueller@suse.de \
--cc=linux-fsdevel@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).