From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753445AbdFVVH5 (ORCPT ); Thu, 22 Jun 2017 17:07:57 -0400 Received: from mail.skyhub.de ([5.9.137.197]:44668 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751224AbdFVVH4 (ORCPT ); Thu, 22 Jun 2017 17:07:56 -0400 Date: Thu, 22 Jun 2017 23:07:34 +0200 From: Borislav Petkov To: "Gustavo A. R. Silva" Cc: Tony Luck , Mauro Carvalho Chehab , linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org, Qiuxu Zhuo Subject: Re: [PATCH 2/2] edac: pnd2_edac: remove useless variable assignment Message-ID: <20170622210734.4rndah3dptek6jlw@pd.tnic> References: <20170622192646.GA14339@embeddedgus> <20170622193010.GA14399@embeddedgus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20170622193010.GA14399@embeddedgus> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 22, 2017 at 02:30:10PM -0500, Gustavo A. R. Silva wrote: > Value assigned to variable _ret_ at line 176 is overwritten > a few lines below before it can be used. This makes such > variable assignment useless. > > Addresses-Coverity-ID: 1403730 Get rid of this tag... > Signed-off-by: Gustavo A. R. Silva > --- > drivers/edac/pnd2_edac.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/edac/pnd2_edac.c b/drivers/edac/pnd2_edac.c > index c51ec73..d1de53e 100644 > --- a/drivers/edac/pnd2_edac.c > +++ b/drivers/edac/pnd2_edac.c > @@ -173,7 +173,7 @@ static int apl_rd_reg(int port, int off, int op, void *data, size_t sz, char *na > edac_dbg(2, "Read %s port=%x off=%x op=%x\n", name, port, off, op); > switch (sz) { > case 8: > - ret = sbi_send(port, off + 4, op, (u32 *)(data + 4)); > + sbi_send(port, off + 4, op, (u32 *)(data + 4)); ... keep ret but OR it in with its previous value: case 8: ret = sbi_send(port, off + 4, op, (u32 *)(data + 4)); /* fall through */ case 4: ret |= sbi_send(port, off, op, (u32 *)data); > /* fall through */ > case 4: > ret = sbi_send(port, off, op, (u32 *)data); ... and merge both into a single patch. Thanks. -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply.