All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Luck, Tony" <tony.luck@intel.com>
To: Borislav Petkov <bp@alien8.de>
Cc: YueHaibing <yuehaibing@huawei.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	linux-edac@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [-next] EDAC: Remove set but not used variable 'type'
Date: Tue, 25 Sep 2018 10:15:39 -0700	[thread overview]
Message-ID: <20180925171539.GA16543@agluck-desk> (raw)

On Tue, Sep 25, 2018 at 12:11:07PM +0200, Borislav Petkov wrote:
> On Tue, Sep 25, 2018 at 02:36:04AM +0000, YueHaibing wrote:
> >  	if (uncorrected_error) {
> > -		if (ripv) {
> > -			type = "FATAL";
> > +		if (ripv)
> >  			tp_event = HW_EVENT_ERR_FATAL;
> > -		} else {
> > -			type = "NON_FATAL";
> > +		else
> >  			tp_event = HW_EVENT_ERR_UNCORRECTED;
> > -		}
> >  	} else {
> > -		type = "CORRECTED";
> >  		tp_event = HW_EVENT_ERR_CORRECTED;
> >  	}
> 
> Looks like this @type thing was never used. Tony, did you want to use it
> for something?

That block of code looks to have been pasted from sb_edac.c, so likely
need the same fix there.

It also looks to be wrong. Saying "FATAL" if mcgstatus.ripv is set
looks wrong (and incomplete). If RIPV is *NOT* set, then this is fatal.
But if it is set, then we should be looking at other bits (like PCC
and AR) ... or maybe just calling mce_severity()?

Perhaps a moot point though. If the error is fatal, then we'll panic
instead of calling the EDAC driver.

-Tony

WARNING: multiple messages have this Message-ID (diff)
From: "Luck, Tony" <tony.luck@intel.com>
To: Borislav Petkov <bp@alien8.de>
Cc: YueHaibing <yuehaibing@huawei.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	linux-edac@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH -next] EDAC: Remove set but not used variable 'type'
Date: Tue, 25 Sep 2018 17:15:39 +0000	[thread overview]
Message-ID: <20180925171539.GA16543@agluck-desk> (raw)
In-Reply-To: <1537842964-109749-1-git-send-email-yuehaibing@huawei.com>

On Tue, Sep 25, 2018 at 12:11:07PM +0200, Borislav Petkov wrote:
> On Tue, Sep 25, 2018 at 02:36:04AM +0000, YueHaibing wrote:
> >  	if (uncorrected_error) {
> > -		if (ripv) {
> > -			type = "FATAL";
> > +		if (ripv)
> >  			tp_event = HW_EVENT_ERR_FATAL;
> > -		} else {
> > -			type = "NON_FATAL";
> > +		else
> >  			tp_event = HW_EVENT_ERR_UNCORRECTED;
> > -		}
> >  	} else {
> > -		type = "CORRECTED";
> >  		tp_event = HW_EVENT_ERR_CORRECTED;
> >  	}
> 
> Looks like this @type thing was never used. Tony, did you want to use it
> for something?

That block of code looks to have been pasted from sb_edac.c, so likely
need the same fix there.

It also looks to be wrong. Saying "FATAL" if mcgstatus.ripv is set
looks wrong (and incomplete). If RIPV is *NOT* set, then this is fatal.
But if it is set, then we should be looking at other bits (like PCC
and AR) ... or maybe just calling mce_severity()?

Perhaps a moot point though. If the error is fatal, then we'll panic
instead of calling the EDAC driver.

-Tony

             reply	other threads:[~2018-09-25 17:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-25 17:15 Luck, Tony [this message]
2018-09-25 17:15 ` [PATCH -next] EDAC: Remove set but not used variable 'type' Luck, Tony
  -- strict thread matches above, loose matches on Subject: below --
2018-10-04 10:49 [-next] " YueHaibing
2018-10-04 10:49 ` [PATCH -next] " YueHaibing
2018-09-25 10:11 [-next] " Borislav Petkov
2018-09-25 10:11 ` [PATCH -next] " Borislav Petkov
2018-09-25  2:36 [-next] " YueHaibing
2018-09-25  2:36 ` [PATCH -next] " YueHaibing

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=20180925171539.GA16543@agluck-desk \
    --to=tony.luck@intel.com \
    --cc=bp@alien8.de \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-edac@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=yuehaibing@huawei.com \
    /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.