[prev in list] [next in list] [prev in thread] [next in thread]
List: linux-s390
Subject: Re: [PATCH 13/13] s390/irq: make return of 0 explicit
From: Heiko Carstens <heiko.carstens () de ! ibm ! com>
Date: 2014-05-19 6:03:18
Message-ID: 20140519060318.GA4459 () osiris
[Download RAW message or body]
On Mon, May 19, 2014 at 06:31:15AM +0200, Julia Lawall wrote:
> From: Julia Lawall <Julia.Lawall@lip6.fr>
>
> 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/)
>
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
>
> ---
> arch/s390/oprofile/hwsampler.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/arch/s390/oprofile/hwsampler.c b/arch/s390/oprofile/hwsampler.c
> index 276f2e2..28b2760 100644
> --- a/arch/s390/oprofile/hwsampler.c
> +++ b/arch/s390/oprofile/hwsampler.c
> @@ -212,10 +212,8 @@ static void init_all_cpu_buffers(void)
> static int prepare_cpu_buffers(void)
> {
> int cpu;
> - int rc;
> struct hws_cpu_buffer *cb;
>
> - rc = 0;
> for_each_online_cpu(cpu) {
> cb = &per_cpu(sampler_cpu_buffer, cpu);
> atomic_set(&cb->ext_params, 0);
> @@ -231,7 +229,7 @@ static int prepare_cpu_buffers(void)
> cb->stop_mode = 0;
> }
>
> - return rc;
> + return 0;
> }
Thanks Julia,
I applied a slightly different version which also turns prepare_cpu_buffers
into a void returning function.
--
To unsubscribe from this list: send the line "unsubscribe linux-s390" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic