[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <534C0AB8.7050209@zytor.com>
Date: Mon, 14 Apr 2014 09:20:08 -0700
From: "H. Peter Anvin" <hpa@...or.com>
To: "Chen, Gong" <gong.chen@...ux.intel.com>, tony.luck@...el.com
CC: tglx@...utronix.de, mingo@...nel.org, linux-kernel@...r.kernel.org,
linux-tip-commits@...r.kernel.org
Subject: Re: [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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists