diff options
author | Julia Lawall <Julia.Lawall@lip6.fr> | 2014-05-19 00:31:15 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2014-05-27 04:26:00 -0400 |
commit | 94414ca08afabbb5d19511ef57ec397a07fc6d35 (patch) | |
tree | 8255acd9fdf438e4378c5fd0f6cc39f58acd9523 /arch/s390/oprofile | |
parent | 470ada6b1a1d80a173586c036f84e2c3a486ebf9 (diff) |
s390/oprofile: make return of 0 explicit
Delete unnecessary local variable whose value is always 0 and that hides
the fact that the result is always 0.
A simplified version of the semantic patch that fixes this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
@r exists@
local idexpression ret;
expression e;
position p;
@@
-ret = 0;
... when != ret = e
return
- ret
+ 0
;
// </smpl>
[heiko.carstens: turn prepare_cpu_buffers into a void returning function]
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/oprofile')
-rw-r--r-- | arch/s390/oprofile/hwsampler.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/arch/s390/oprofile/hwsampler.c b/arch/s390/oprofile/hwsampler.c index 276f2e26c761..e53c6f268807 100644 --- a/arch/s390/oprofile/hwsampler.c +++ b/arch/s390/oprofile/hwsampler.c | |||
@@ -209,13 +209,11 @@ static void init_all_cpu_buffers(void) | |||
209 | } | 209 | } |
210 | } | 210 | } |
211 | 211 | ||
212 | static int prepare_cpu_buffers(void) | 212 | static void prepare_cpu_buffers(void) |
213 | { | 213 | { |
214 | int cpu; | ||
215 | int rc; | ||
216 | struct hws_cpu_buffer *cb; | 214 | struct hws_cpu_buffer *cb; |
215 | int cpu; | ||
217 | 216 | ||
218 | rc = 0; | ||
219 | for_each_online_cpu(cpu) { | 217 | for_each_online_cpu(cpu) { |
220 | cb = &per_cpu(sampler_cpu_buffer, cpu); | 218 | cb = &per_cpu(sampler_cpu_buffer, cpu); |
221 | atomic_set(&cb->ext_params, 0); | 219 | atomic_set(&cb->ext_params, 0); |
@@ -230,8 +228,6 @@ static int prepare_cpu_buffers(void) | |||
230 | cb->oom = 0; | 228 | cb->oom = 0; |
231 | cb->stop_mode = 0; | 229 | cb->stop_mode = 0; |
232 | } | 230 | } |
233 | |||
234 | return rc; | ||
235 | } | 231 | } |
236 | 232 | ||
237 | /* | 233 | /* |
@@ -1107,9 +1103,7 @@ int hwsampler_start_all(unsigned long rate) | |||
1107 | if (rc) | 1103 | if (rc) |
1108 | goto start_all_exit; | 1104 | goto start_all_exit; |
1109 | 1105 | ||
1110 | rc = prepare_cpu_buffers(); | 1106 | prepare_cpu_buffers(); |
1111 | if (rc) | ||
1112 | goto start_all_exit; | ||
1113 | 1107 | ||
1114 | for_each_online_cpu(cpu) { | 1108 | for_each_online_cpu(cpu) { |
1115 | rc = start_sampling(cpu); | 1109 | rc = start_sampling(cpu); |
@@ -1156,7 +1150,7 @@ int hwsampler_stop_all(void) | |||
1156 | rc = 0; | 1150 | rc = 0; |
1157 | if (hws_state == HWS_INIT) { | 1151 | if (hws_state == HWS_INIT) { |
1158 | mutex_unlock(&hws_sem); | 1152 | mutex_unlock(&hws_sem); |
1159 | return rc; | 1153 | return 0; |
1160 | } | 1154 | } |
1161 | hws_state = HWS_STOPPING; | 1155 | hws_state = HWS_STOPPING; |
1162 | mutex_unlock(&hws_sem); | 1156 | mutex_unlock(&hws_sem); |