Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753892AbdFVVn4 (ORCPT ); Thu, 22 Jun 2017 17:43:56 -0400 Received: from gateway36.websitewelcome.com ([192.185.193.119]:13946 "EHLO gateway36.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753482AbdFVVns (ORCPT ); Thu, 22 Jun 2017 17:43:48 -0400 Date: Thu, 22 Jun 2017 16:43:45 -0500 Message-ID: <20170622164345.Horde.SwUuX9eHAPqyFo5pq1RUp09@gator4166.hostgator.com> From: "Gustavo A. R. Silva" To: Borislav Petkov 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 References: <20170622192646.GA14339@embeddedgus> <20170622193010.GA14399@embeddedgus> <20170622210734.4rndah3dptek6jlw@pd.tnic> In-Reply-To: <20170622210734.4rndah3dptek6jlw@pd.tnic> User-Agent: Horde Application Framework 5 Content-Type: text/plain; charset=utf-8; format=flowed; DelSp=Yes MIME-Version: 1.0 Content-Disposition: inline X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator4166.hostgator.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - embeddedor.com X-BWhitelist: no X-Source-IP: 108.167.133.22 X-Exim-ID: 1dO9tB-0022Gk-MY X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: gator4166.hostgator.com [108.167.133.22]:34915 X-Source-Auth: garsilva@embeddedor.com X-Email-Count: 2 X-Source-Cap: Z3V6aWRpbmU7Z3V6aWRpbmU7Z2F0b3I0MTY2Lmhvc3RnYXRvci5jb20= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1470 Lines: 54 Hi Borislav, Quoting Borislav Petkov : > 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. > I got it. I'll send a new patch shortly. Thanks! -- Gustavo A. R. Silva