All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
To: Borislav Petkov <bp@alien8.de>
Cc: David Binderman <dcb314@hotmail.com>,
	"mchehab@kernel.org" <mchehab@kernel.org>,
	"linux-edac@vger.kernel.org" <linux-edac@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: edac/i7300_edac.c:307: strange macro ?
Date: Thu, 26 Jan 2017 06:57:44 -0200	[thread overview]
Message-ID: <20170126065744.5425e6da@vento.lan> (raw)
In-Reply-To: <20170125153728.ag25o64q23a4xeb2@pd.tnic>

Em Wed, 25 Jan 2017 16:37:28 +0100
Borislav Petkov <bp@alien8.de> 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 <bp@suse.de>
> 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 <bp@suse.de>
> Reported-by: David Binderman <dcb314@hotmail.com>

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 <mchehab@s-opensource.com>


> ---
>  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

  reply	other threads:[~2017-01-26  8:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <VI1PR08MB1022F62928A4F5D396DA8FFD9C660@VI1PR08MB1022.eurprd08.prod.outlook.com>
2017-01-11 22:58 ` edac/i7300_edac.c:307: strange macro ? Borislav Petkov
     [not found]   ` <VI1PR08MB1022FEBA2CB88AE10D7319DA9C660@VI1PR08MB1022.eurprd08.prod.outlook.com>
2017-01-25 11:58     ` Borislav Petkov
     [not found]       ` <VI1PR08MB102297E01770CE3D7CF4F17A9C740@VI1PR08MB1022.eurprd08.prod.outlook.com>
2017-01-25 15:37         ` Borislav Petkov
2017-01-26  8:57           ` Mauro Carvalho Chehab [this message]
2017-01-26 10:36             ` Borislav Petkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170126065744.5425e6da@vento.lan \
    --to=mchehab@osg.samsung.com \
    --cc=bp@alien8.de \
    --cc=dcb314@hotmail.com \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mchehab@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.