blob: e85ca96fc341573d6e4c8ffdd15add1c2b0b6b0f [file] [log] [blame]
Andrew Geissler69721092021-07-23 12:57:00 -04001From 0b2f611a95f3c93454453892bbe021ad2815925d Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Tue, 15 Jun 2021 17:35:26 -0700
4Subject: [PATCH] perf_examples: Remove unused 'sum' variable
5
6Fixes
7self_smpl_multi.c:144:19: error: variable 'sum' set but not used [-Werror,-Wunused-but-set-variable]
8 unsigned long x, sum;
9 ^
10Upstream-Status: Pending
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12---
13 perf_examples/self_smpl_multi.c | 5 +----
14 1 file changed, 1 insertion(+), 4 deletions(-)
15
16diff --git a/perf_examples/self_smpl_multi.c b/perf_examples/self_smpl_multi.c
17index 391fa61..75b45e0 100644
18--- a/perf_examples/self_smpl_multi.c
19+++ b/perf_examples/self_smpl_multi.c
20@@ -141,7 +141,7 @@ void
21 do_cycles(void)
22 {
23 struct timeval start, last, now;
24- unsigned long x, sum;
25+ unsigned long x;
26
27 gettimeofday(&start, NULL);
28 last = start;
29@@ -150,15 +150,12 @@ do_cycles(void)
30 iter[myid] = 0;
31
32 do {
33-
34- sum = 1;
35 for (x = 1; x < 250000; x++) {
36 /* signal pending to private queue because of
37 * pthread_kill(), i.e., tkill()
38 */
39 if ((x % 5000) == 0)
40 pthread_kill(pthread_self(), SIGUSR1);
41- sum += x;
42 }
43 iter[myid]++;
44