lkml.org 
[lkml]   [2014]   [Apr]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] x86, MCE: Cleanup macro __get_cpu_var
On 04/14/2014 01:39 AM, Chen, Gong wrote:
> @@ -1287,14 +1287,14 @@ static unsigned long (*mce_adjust_timer)(unsigned long interval) =
>
> static int cmc_error_seen(void)
> {
> - unsigned long *v = &__get_cpu_var(mce_polled_error);
> + unsigned long *v = this_cpu_ptr(&mce_polled_error);
>
> - return test_and_clear_bit(0, v);
> + return this_cpu_xchg(*v, 0);
> }
>

Here you produce a pointer and *then* passing it through a this_cpu_
function... this is actively wrong.

It should simply be:

return this_cpu_xchg(mce_polled_error, 0);

-hpa



\
 
 \ /
  Last update: 2014-04-14 18:41    [W:1.066 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site