All of lore.kernel.org
 help / color / mirror / Atom feed
* [-next] EDAC: Remove set but not used variable 'type'
@ 2018-09-25  2:36 ` YueHaibing
  0 siblings, 0 replies; 8+ messages in thread
From: YueHaibing @ 2018-09-25  2:36 UTC (permalink / raw)
  To: Tony Luck, Borislav Petkov, Mauro Carvalho Chehab
  Cc: YueHaibing, linux-edac, kernel-janitors

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/edac/skx_edac.c: In function 'skx_mce_output_error':
drivers/edac/skx_edac.c:949:8: warning:
 variable 'type' set but not used [-Wunused-but-set-variable]

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/edac/skx_edac.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/edac/skx_edac.c b/drivers/edac/skx_edac.c
index b2987ef..3ffdbc4 100644
--- a/drivers/edac/skx_edac.c
+++ b/drivers/edac/skx_edac.c
@@ -959,15 +959,11 @@ static void skx_mce_output_error(struct mem_ctl_info *mci,
 	recoverable = GET_BITFIELD(m->status, 56, 56);
 
 	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;
 	}


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH -next] EDAC: Remove set but not used variable 'type'
@ 2018-09-25  2:36 ` YueHaibing
  0 siblings, 0 replies; 8+ messages in thread
From: YueHaibing @ 2018-09-25  2:36 UTC (permalink / raw)
  To: Tony Luck, Borislav Petkov, Mauro Carvalho Chehab
  Cc: YueHaibing, linux-edac, kernel-janitors

Fixes gcc '-Wunused-but-set-variable' warning:

drivers/edac/skx_edac.c: In function 'skx_mce_output_error':
drivers/edac/skx_edac.c:949:8: warning:
 variable 'type' set but not used [-Wunused-but-set-variable]

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/edac/skx_edac.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/edac/skx_edac.c b/drivers/edac/skx_edac.c
index b2987ef..3ffdbc4 100644
--- a/drivers/edac/skx_edac.c
+++ b/drivers/edac/skx_edac.c
@@ -959,15 +959,11 @@ static void skx_mce_output_error(struct mem_ctl_info *mci,
 	recoverable = GET_BITFIELD(m->status, 56, 56);
 
 	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;
 	}

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [-next] EDAC: Remove set but not used variable 'type'
  2018-09-25  2:36 ` [PATCH -next] " YueHaibing
@ 2018-09-25 10:11 ` Borislav Petkov
  -1 siblings, 0 replies; 8+ messages in thread
From: Borislav Petkov @ 2018-09-25 10:11 UTC (permalink / raw)
  To: Tony Luck; +Cc: YueHaibing, Mauro Carvalho Chehab, linux-edac, kernel-janitors

On Tue, Sep 25, 2018 at 02:36:04AM +0000, YueHaibing wrote:
> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> drivers/edac/skx_edac.c: In function 'skx_mce_output_error':
> drivers/edac/skx_edac.c:949:8: warning:
>  variable 'type' set but not used [-Wunused-but-set-variable]
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>  drivers/edac/skx_edac.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/edac/skx_edac.c b/drivers/edac/skx_edac.c
> index b2987ef..3ffdbc4 100644
> --- a/drivers/edac/skx_edac.c
> +++ b/drivers/edac/skx_edac.c
> @@ -959,15 +959,11 @@ static void skx_mce_output_error(struct mem_ctl_info *mci,
>  	recoverable = GET_BITFIELD(m->status, 56, 56);
>  
>  	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?

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH -next] EDAC: Remove set but not used variable 'type'
@ 2018-09-25 10:11 ` Borislav Petkov
  0 siblings, 0 replies; 8+ messages in thread
From: Borislav Petkov @ 2018-09-25 10:11 UTC (permalink / raw)
  To: Tony Luck; +Cc: YueHaibing, Mauro Carvalho Chehab, linux-edac, kernel-janitors

On Tue, Sep 25, 2018 at 02:36:04AM +0000, YueHaibing wrote:
> Fixes gcc '-Wunused-but-set-variable' warning:
> 
> drivers/edac/skx_edac.c: In function 'skx_mce_output_error':
> drivers/edac/skx_edac.c:949:8: warning:
>  variable 'type' set but not used [-Wunused-but-set-variable]
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>  drivers/edac/skx_edac.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/edac/skx_edac.c b/drivers/edac/skx_edac.c
> index b2987ef..3ffdbc4 100644
> --- a/drivers/edac/skx_edac.c
> +++ b/drivers/edac/skx_edac.c
> @@ -959,15 +959,11 @@ static void skx_mce_output_error(struct mem_ctl_info *mci,
>  	recoverable = GET_BITFIELD(m->status, 56, 56);
>  
>  	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?

-- 
Regards/Gruss,
    Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [-next] EDAC: Remove set but not used variable 'type'
  2018-09-25  2:36 ` [PATCH -next] " YueHaibing
@ 2018-09-25 17:15 ` Luck, Tony
  -1 siblings, 0 replies; 8+ messages in thread
From: Luck, Tony @ 2018-09-25 17:15 UTC (permalink / raw)
  To: Borislav Petkov
  Cc: YueHaibing, Mauro Carvalho Chehab, linux-edac, kernel-janitors

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH -next] EDAC: Remove set but not used variable 'type'
@ 2018-09-25 17:15 ` Luck, Tony
  0 siblings, 0 replies; 8+ messages in thread
From: Luck, Tony @ 2018-09-25 17:15 UTC (permalink / raw)
  To: Borislav Petkov
  Cc: YueHaibing, Mauro Carvalho Chehab, linux-edac, kernel-janitors

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [-next] EDAC: Remove set but not used variable 'type'
  2018-09-25  2:36 ` [PATCH -next] " YueHaibing
@ 2018-10-04 10:49 ` YueHaibing
  -1 siblings, 0 replies; 8+ messages in thread
From: YueHaibing @ 2018-10-04 10:49 UTC (permalink / raw)
  To: Luck, Tony, Borislav Petkov
  Cc: Mauro Carvalho Chehab, linux-edac, kernel-janitors

On 2018/9/26 1:15, Luck, Tony wrote:
> 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.

Thank you for comment

> 
> -Tony
> 
> .
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH -next] EDAC: Remove set but not used variable 'type'
@ 2018-10-04 10:49 ` YueHaibing
  0 siblings, 0 replies; 8+ messages in thread
From: YueHaibing @ 2018-10-04 10:49 UTC (permalink / raw)
  To: Luck, Tony, Borislav Petkov
  Cc: Mauro Carvalho Chehab, linux-edac, kernel-janitors

On 2018/9/26 1:15, Luck, Tony wrote:
> 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.

Thank you for comment

> 
> -Tony
> 
> .
> 

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-10-04 10:49 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-04 10:49 [-next] EDAC: Remove set but not used variable 'type' YueHaibing
2018-10-04 10:49 ` [PATCH -next] " YueHaibing
  -- strict thread matches above, loose matches on Subject: below --
2018-09-25 17:15 [-next] " Luck, Tony
2018-09-25 17:15 ` [PATCH -next] " Luck, Tony
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

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.