diff options
author | Christoph Lameter <cl@linux.com> | 2010-12-06 12:16:26 -0500 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2010-12-17 09:07:19 -0500 |
commit | 5309665dcc1143d659d82568da8d00f0e08a58f9 (patch) | |
tree | 8c1682a7dded806c4aa942d18c856bc30eaadad5 | |
parent | b76834bc1b6db0a0923eed85c81b1113021b0612 (diff) |
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 <w.d.hubbs@gmail.com>
Cc: Sedat Dilek <sedat.dilek@gmail.com>
Acked-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Christoph Lameter <cl@linux.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
-rw-r--r-- | drivers/staging/speakup/fakekey.c | 7 |
1 files changed, 1 insertions, 6 deletions
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) | |||
95 | */ | 95 | */ |
96 | bool speakup_fake_key_pressed(void) | 96 | bool speakup_fake_key_pressed(void) |
97 | { | 97 | { |
98 | bool is_pressed; | 98 | return this_cpu_read(reporting_keystroke); |
99 | |||
100 | is_pressed = get_cpu_var(reporting_keystroke); | ||
101 | put_cpu_var(reporting_keystroke); | ||
102 | |||
103 | return is_pressed; | ||
104 | } | 99 | } |