From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753098AbdAZI5x (ORCPT ); Thu, 26 Jan 2017 03:57:53 -0500 Received: from ec2-52-27-115-49.us-west-2.compute.amazonaws.com ([52.27.115.49]:45686 "EHLO osg.samsung.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752875AbdAZI5v (ORCPT ); Thu, 26 Jan 2017 03:57:51 -0500 Date: Thu, 26 Jan 2017 06:57:44 -0200 From: Mauro Carvalho Chehab To: Borislav Petkov Cc: David Binderman , "mchehab@kernel.org" , "linux-edac@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: edac/i7300_edac.c:307: strange macro ? Message-ID: <20170126065744.5425e6da@vento.lan> In-Reply-To: <20170125153728.ag25o64q23a4xeb2@pd.tnic> References: <20170111225830.xkqrvrfzv4swcrik@pd.tnic> <20170125115856.4bu3pd4xwry76uow@pd.tnic> <20170125153728.ag25o64q23a4xeb2@pd.tnic> Organization: Samsung X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Wed, 25 Jan 2017 16:37:28 +0100 Borislav Petkov escreveu: > On Wed, Jan 25, 2017 at 12:04:04PM +0000, David Binderman wrote: > > You'll have a very long wait to get a linux patch from me. > > > > I am happy for someone else to invent a patch. > > Ah ok, I thought you wanted to give it a try and would want me to help > you with it. :-) > > Anyway, here it is: > > --- > From: Borislav Petkov > Date: Wed, 25 Jan 2017 16:08:27 +0100 > Subject: [PATCH] EDAC, i7300: Test for the second channel properly > > REDMEMB[17] is the ECC_Locator bit, which, when set, identifies the > CS[3:2] as the simbols in error. And thus the second channel. > > The macro computing it was wrong so get rid of it (it was used at one > place only) and get rid of the conditional too. Generates better code > this way anyway. > > Signed-off-by: Borislav Petkov > Reported-by: David Binderman Seems OK to me. Do you want to put it on your tree, or do you prefer if I put it on mine? If you prefer to send via your tree: Reviewed-by: Mauro Carvalho Chehab > --- > drivers/edac/i7300_edac.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/edac/i7300_edac.c b/drivers/edac/i7300_edac.c > index 0a912bf6de00..e391f5a716be 100644 > --- a/drivers/edac/i7300_edac.c > +++ b/drivers/edac/i7300_edac.c > @@ -304,7 +304,6 @@ static const char *ferr_global_lo_name[] = { > #define REDMEMA 0xdc > > #define REDMEMB 0x7c > - #define IS_SECOND_CH(v) ((v) * (1 << 17)) > > #define RECMEMA 0xe0 > #define RECMEMA_BANK(v) (((v) >> 12) & 7) > @@ -483,8 +482,9 @@ static void i7300_process_fbd_error(struct mem_ctl_info *mci) > pci_read_config_dword(pvt->pci_dev_16_1_fsb_addr_map, > REDMEMB, &value); > channel = (branch << 1); > - if (IS_SECOND_CH(value)) > - channel++; > + > + /* Second channel ? */ > + channel += !!(value & BIT(17)); > > /* Clear the error bit */ > pci_write_config_dword(pvt->pci_dev_16_1_fsb_addr_map, -- Thanks, Mauro