[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140519060318.GA4459@osiris>
Date: Mon, 19 May 2014 08:03:18 +0200
From: Heiko Carstens <heiko.carstens@...ibm.com>
To: Julia Lawall <Julia.Lawall@...6.fr>
Cc: Robert Richter <rric@...nel.org>, kernel-janitors@...r.kernel.org,
Martin Schwidefsky <schwidefsky@...ibm.com>,
linux390@...ibm.com, oprofile-list@...ts.sf.net,
linux-s390@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 13/13] s390/irq: make return of 0 explicit
On Mon, May 19, 2014 at 06:31:15AM +0200, Julia Lawall wrote:
> From: Julia Lawall <Julia.Lawall@...6.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@...6.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-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists