Re: [PATCH 2/2] x86, MCE: Cleanup macro __get_cpu_var

From: H. Peter Anvin
Date: Mon Apr 14 2014 - 12:19:34 EST


On 04/14/2014 01:39 AM, Chen, Gong wrote:
> @@ -619,7 +619,7 @@ void machine_check_poll(enum mcp_flags flags, mce_banks_t *b)
> continue;
>
> v = &get_cpu_var(mce_polled_error);
> - set_bit(0, v);
> + *v = 1;
> put_cpu_var(mce_polled_error);
> /*
> * Uncorrected or signalled events are handled by the exception

The amazing thing is that you managed to miss the one place where you
could actively elide a pointer.

The above should simply be:

this_cpu_write(mce_polled_error, 1);

-hpa

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/