From: Christoph Lameter Date: Mon, 6 Dec 2010 17:16:26 +0000 (-0600) Subject: fakekey: Simplify speakup_fake_key_pressed through this_cpu_ops X-Git-Tag: v2.6.38-rc1~455^2~19 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=5309665dcc1143d659d82568da8d00f0e08a58f9;p=karo-tx-linux.git fakekey: Simplify speakup_fake_key_pressed through this_cpu_ops The whole function can be expressed as a simple this_cpu_read() operation. The function overhead is now likely multiple times that of the single instruction that is executed in it. Sedat: fixed compile failure caused by an extra ')'. Cc: William Hubbs Cc: Sedat Dilek Acked-by: H. Peter Anvin Signed-off-by: Christoph Lameter Signed-off-by: Tejun Heo --- diff --git a/drivers/staging/speakup/fakekey.c b/drivers/staging/speakup/fakekey.c index bf4ec68ac2eb..1b34a8771641 100644 --- a/drivers/staging/speakup/fakekey.c +++ b/drivers/staging/speakup/fakekey.c @@ -95,10 +95,5 @@ void speakup_fake_down_arrow(void) */ bool speakup_fake_key_pressed(void) { - bool is_pressed; - - is_pressed = get_cpu_var(reporting_keystroke); - put_cpu_var(reporting_keystroke); - - return is_pressed; + return this_cpu_read(reporting_keystroke); }