Andrew Geissler | 6972109 | 2021-07-23 12:57:00 -0400 | [diff] [blame] | 1 | From 0b2f611a95f3c93454453892bbe021ad2815925d Mon Sep 17 00:00:00 2001 |
| 2 | From: Khem Raj <raj.khem@gmail.com> |
| 3 | Date: Tue, 15 Jun 2021 17:35:26 -0700 |
| 4 | Subject: [PATCH] perf_examples: Remove unused 'sum' variable |
| 5 | |
| 6 | Fixes |
| 7 | self_smpl_multi.c:144:19: error: variable 'sum' set but not used [-Werror,-Wunused-but-set-variable] |
| 8 | unsigned long x, sum; |
| 9 | ^ |
| 10 | Upstream-Status: Pending |
| 11 | Signed-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 | |
| 16 | diff --git a/perf_examples/self_smpl_multi.c b/perf_examples/self_smpl_multi.c |
| 17 | index 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 | |