From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Mon, 19 May 2014 08:03:18 +0200 From: Heiko Carstens Subject: Re: [PATCH 13/13] s390/irq: make return of 0 explicit Message-ID: <20140519060318.GA4459@osiris> References: <1400473875-22228-1-git-send-email-Julia.Lawall@lip6.fr> <1400473875-22228-14-git-send-email-Julia.Lawall@lip6.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1400473875-22228-14-git-send-email-Julia.Lawall@lip6.fr> Sender: linux-kernel-owner@vger.kernel.org List-Archive: List-Post: To: Julia Lawall Cc: Robert Richter , kernel-janitors@vger.kernel.org, Martin Schwidefsky , linux390@de.ibm.com, oprofile-list@lists.sf.net, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org List-ID: On Mon, May 19, 2014 at 06:31:15AM +0200, Julia Lawall wrote: > From: Julia Lawall > > 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 > > --- > 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.