diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2013-10-11 19:34:17 -0400 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2013-10-13 17:56:54 -0400 |
commit | 872c8faaf2009422a91d227ae0b5c6f04c9d2c69 (patch) | |
tree | a6b03abbcd801638098ec591f48873b39f6a0dcd /src/bootchart | |
parent | 51d122af23533b0b8318911c4fc8b128ad8eafb7 (diff) |
Fix write-only use of a few variables
Since the invention of read-only memory, write-only memory has been
considered deprecated. Where appropriate, either make use of the
value, or avoid writing it, to make it clear that it is not used.
Diffstat (limited to 'src/bootchart')
-rw-r--r-- | src/bootchart/bootchart.c | 2 | ||||
-rw-r--r-- | src/bootchart/svg.c | 18 |
2 files changed, 7 insertions, 13 deletions
diff --git a/src/bootchart/bootchart.c b/src/bootchart/bootchart.c index 14ccd3efe5..edbd3815cd 100644 --- a/src/bootchart/bootchart.c +++ b/src/bootchart/bootchart.c @@ -254,7 +254,7 @@ static void do_journal_append(char *file) p = malloc(9 + BOOTCHART_MAX); if (!p) { - r = log_oom(); + log_oom(); return; } diff --git a/src/bootchart/svg.c b/src/bootchart/svg.c index 5eee2d1987..7ac0138a2b 100644 --- a/src/bootchart/svg.c +++ b/src/bootchart/svg.c @@ -420,13 +420,10 @@ static void svg_pss_graph(void) { i = 1; LIST_FOREACH_BEFORE(link, sampledata, head) { int bottom; - int top; + int top = 0; struct ps_sched_struct *prev_sample; struct ps_sched_struct *cross_place; - bottom = 0; - top = 0; - /* put all the small pss blocks into the bottom */ ps = ps_first->next_ps; while (ps->next_ps) { @@ -533,8 +530,8 @@ static void svg_io_bi_bar(void) { int max_here = 0; int i; int k; - struct list_sample_data *start_sampledata = sampledata; - struct list_sample_data *stop_sampledata = sampledata; + struct list_sample_data *start_sampledata; + struct list_sample_data *stop_sampledata; svg("<!-- IO utilization graph - In -->\n"); @@ -599,10 +596,7 @@ static void svg_io_bi_bar(void) { int stop; int diff; double tot; - double pbi; - - tot = 0; - pbi = 0; + double pbi = 0; start = MAX(i - ((range / 2) - 1), 0); stop = MIN(i + (range / 2), samples); @@ -647,8 +641,8 @@ static void svg_io_bo_bar(void) { int max_here = 0; int i; int k; - struct list_sample_data *start_sampledata = sampledata; - struct list_sample_data *stop_sampledata = sampledata; + struct list_sample_data *start_sampledata; + struct list_sample_data *stop_sampledata; svg("<!-- IO utilization graph - out -->\n"); |